This commit is contained in:
2026-01-19 05:43:29 +09:00
parent 40f41a4fd0
commit 0f6fddd794
36 changed files with 1724 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
const std = @import("std");
const expect = std.testing.expect;
const math = std.math;
// The built-in function `@import` takes in a file, and gives you a struct type based on that file.
// All declarations labelled as `pub` (for public) will end up in this struct type, ready for use.
// `@import("std")` is a special case in the compiler, and gives you access to the standard library.
// Other `@import`s will take in a file path, or a package name (more on packages in a later chapter).
// We will explore more of the standard library in later chapters.
test "imports" {
try expect(math.pow(f32, 2, 3) == 8.0);
}