Sfoglia il codice sorgente

Add assert(…) to the docs

David Peter 2 anni fa
parent
commit
0b949c50a6
2 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. 3 0
      book/src/example-numbat_syntax.md
  2. 3 0
      examples/numbat_syntax.nbt

+ 3 - 0
book/src/example-numbat_syntax.md

@@ -103,6 +103,9 @@ print(2 kilowarhol)              # Print the value of an expression
 print("hello world")             # Print a message
 print("value of pi = {pi}")      # String interpolation
 print("sqrt(10) = {sqrt(10)}")   # Expressions in string interpolation
+
+assert(1 yard < 1 meter)         # Assertion
+
 assert_eq(1 ft, 12 in)           # Assert that two quantities are equal
 assert_eq(1 yd, 1 m, 10 cm)      # Assert that two quantities are equal, up to
                                  # the given precision

+ 3 - 0
examples/numbat_syntax.nbt

@@ -98,6 +98,9 @@ print(2 kilowarhol)              # Print the value of an expression
 print("hello world")             # Print a message
 print("value of pi = {pi}")      # String interpolation
 print("sqrt(10) = {sqrt(10)}")   # Expressions in string interpolation
+
+assert(1 yard < 1 meter)         # Assertion
+
 assert_eq(1 ft, 12 in)           # Assert that two quantities are equal
 assert_eq(1 yd, 1 m, 10 cm)      # Assert that two quantities are equal, up to
                                  # the given precision