diff --git a/doc/Introduction.md b/doc/Introduction.md index eeced18a..acb5282a 100644 --- a/doc/Introduction.md +++ b/doc/Introduction.md @@ -44,18 +44,8 @@ prefix notation. Janet also supports the remainder operator, or `%`, which retur the remainder of division. For example, `(% 10 3)` is 1, and `(% 10.5 3)` is 1.5. The lines that begin with `#` are comments. -Janet actually has two "flavors" of numbers; integers and real numbers. Integers are any -integer value between -2,147,483,648 and 2,147,483,647 (32 bit signed integer). -Reals are real numbers, and are represented by IEEE-754 double precision floating point -numbers. That means that they can represent any number an integer can represent, as well -fractions to very high precision. - -Although real numbers can represent any value an integer can, try to distinguish between -real numbers and integers in your program. If you are using a number to index into a structure, -you probably want integers. Otherwise, you may want to use reals (this is only a rule of thumb). - -Arithmetic operator will convert integers to real numbers if needed, but real numbers -will not be converted to integers, as not all real numbers can be safely converted to integers. +All janet numbers are IEEE 754 floating point numbers. They can be used to represent +both integers and real numbers to a finite precision. ## Numeric literals diff --git a/doc/Parser.md b/doc/Parser.md index 9dccff65..f372b4e7 100644 --- a/doc/Parser.md +++ b/doc/Parser.md @@ -70,8 +70,8 @@ in macros. ## Numbers -Janet numbers are represented by either 32 bit integers or -IEEE-754 floating point numbers. The syntax is similar to that of many other languages +Janet numbers are represented by IEEE-754 floating point numbers. +The syntax is similar to that of many other languages as well. Numbers can be written in base 10, with underscores used to separate digits into groups. A decimal point can be used for floating point numbers. Numbers can also be written in other bases by prefixing the number with the desired diff --git a/doc/The-Janet-Abstract-Machine-Bytecode.md b/doc/The-Janet-Abstract-Machine-Bytecode.md index e97f9568..98451b67 100644 --- a/doc/The-Janet-Abstract-Machine-Bytecode.md +++ b/doc/The-Janet-Abstract-Machine-Bytecode.md @@ -153,40 +153,30 @@ failure to return or error. * The `>>>` indicates unsigned right shift, as in Java. Because all integers in janet are signed, we differentiate the two kinds of right bit shift. -* The 'im' suffix in the instruction name is short for immediate. The 'i' suffix is short for integer, - and the 'r' suffix is short for real. +* The 'im' suffix in the instruction name is short for immediate. ### Reference Table | Instruction | Signature | Description | | ----------- | --------------------------- | --------------------------------- | | `add` | `(add dest lhs rhs)` | $dest = $lhs + $rhs | -| `addi` | `(addi dest lhs rhs)` | $dest = $lhs +i $rhs | -| `addim` | `(addim dest lhs im)` | $dest = $lhs +i im | -| `addr` | `(addr dest lhs rhs)` | $dest = $lhs +r $rhs | +| `addim` | `(addim dest lhs im)` | $dest = $lhs + im | | `band` | `(band dest lhs rhs)` | $dest = $lhs & $rhs | | `bnot` | `(bnot dest operand)` | $dest = ~$operand | | `bor` | `(bor dest lhs rhs)` | $dest = $lhs | $rhs | | `bxor` | `(bxor dest lhs rhs)` | $dest = $lhs ^ $rhs | | `call` | `(call dest callee)` | $dest = call($callee, args) | | `clo` | `(clo dest index)` | $dest = closure(defs[$index]) | -| `cmp` | `(cmp dest lhs rhs)` | $dest = janet\_compare($lhs, $rhs) | +| `cmp` | `(cmp dest lhs rhs)` | $dest = janet\_compare($lhs, $rhs)| | `div` | `(div dest lhs rhs)` | $dest = $lhs / $rhs | -| `divi` | `(divi dest lhs rhs)` | $dest = $lhs /i $rhs | -| `divim` | `(divim dest lhs im)` | $dest = $lhs /i im | -| `divr` | `(divr dest lhs rhs)` | $dest = $lhs /r $rhs | +| `divim` | `(divim dest lhs im)` | $dest = $lhs / im | | `eq` | `(eq dest lhs rhs)` | $dest = $lhs == $rhs | -| `eqi` | `(eqi dest lhs rhs)` | $dest = $lhs ==i $rhs | -| `eqim` | `(eqim dest lhs im)` | $dest = $lhs ==i im | -| `eqr` | `(eqr dest lhs rhs)` | $dest = $lhs ==r $rhs | +| `eqim` | `(eqim dest lhs im)` | $dest = $lhs == im | | `err` | `(err message)` | Throw error $message. | | `get` | `(get dest ds key)` | $dest = $ds[$key] | | `geti` | `(geti dest ds index)` | $dest = $ds[index] | -| `gt` | `(gt dest lhs rhs)` | $dest = $lhs > $rhs | -| `gti` | `(gti dest lhs rhs)` | $dest = $lhs \>i $rhs | -| `gtim` | `(gtim dest lhs im)` | $dest = $lhs \>i im | -| `gtr` | `(gtr dest lhs rhs)` | $dest = $lhs \>r $rhs | -| `gter` | `(gter dest lhs rhs)` | $dest = $lhs >=r $rhs | +| `gt` | `(gt dest lhs rhs)` | $dest = $lhs \> $rhs | +| `gtim` | `(gtim dest lhs im)` | $dest = $lhs \> im | | `jmp` | `(jmp label)` | pc = label, pc += offset | | `jmpif` | `(jmpif cond label)` | if $cond pc = label else pc++ | | `jmpno` | `(jmpno cond label)` | if $cond pc++ else pc = label | @@ -198,10 +188,8 @@ failure to return or error. | `ldt` | `(ldt dest)` | $dest = true | | `ldu` | `(ldu dest env index)` | $dest = envs[env][index] | | `len` | `(len dest ds)` | $dest = length(ds) | -| `lt` | `(lt dest lhs rhs)` | $dest = $lhs < $rhs | -| `lti` | `(lti dest lhs rhs)` | $dest = $lhs \