|
|
- test for math:convert
$v[^table::create{value base
10 10
32 10
20 16
-240 10
}]
$b[^table::create{n base
bin 2
oct 8
dec 10
hex 16
}]
^v.menu{
^b.menu{
${b.n}: ^^math:convert[$v.value]($v.base^;$b.base) ^math:convert[$v.value]($v.base;$b.base)
}[<br />]
}[<hr />]
#bin: =^math:convert[ 10 ](10;2)=
#oct: =^math:convert[32 ](10;8)=
#dec: =^math:convert[20 ](16;10)=
#hex: =^math:convert[-240 ](10;16)=
#=^math:convert[asd](10;2)=