HTDB : Docs : Designer's Guide : C-Functions
About
Overview
Philosophy
Features
News
Download
Help Us!

Docs
Overview
Designers
Language
Environment
C-Functions
Crypto
Date/Time
Numeric
Strings
HTML
HTDB
SQL
Debugging
System
User/Session
Credit Card
Misc.
S-Functions
Developers
Roadmap
Architecture

Community
Powered By

[home]
class: Numeric


${abs(integer)}

input

${abs(-3.14)}
yields3  


${int(integer)}

input

${int(-3.14)}
yields-3  

input

${int(3.14)}
yields3  


${random(integer)}

input

${random(1000)}
yields868  

input

${random(1000)}
yields747  


${prettyNumber(integer)}

input

${prettyNumber(1234567)}
yields1,234,567  


${padZero(integer)}

input

${padZero(3)}
yields03  

input

${padZero(33)}
yields33  


${hex2base10(hex)}

input

${hex2base10(ff)}
yields255  

input

${hex2base10(cafebabe)}
yields3405691582  


${num2hex(number)}

input

${num2hex(255)}
yieldsff  

input

${num2hex(1964)}
yields7ac  


${signed(number)}

input

${signed(-666)}
yields-666  

input

${signed(666)}
yields+666  


${eval(expression)}

supported functions: + (addition), - (subtraction), * (multiplication), / (division), (modulus), ^ (exponentiation), sin(), cos(), atan(), abs(), sqrt(), ln(), exp()

this code is derived from Robert B. Stout's SNIPPETS code collection, MicroFirm Function Library (MFL), Copyright 1991-93

input

${eval(1 + 1)}
yields2  

input

${eval(3 * (sin(45) + 1))}
yields5.55271  


${itor(integer)}

due to limitations to the size of their imaginations, really large numbers cannot be encoded into Roman Numeral.

input

${itor(6)}
yieldsVI  

input

${itor(66)}
yieldsLXVI  

input

${itor(666)}
yieldsDCLXVI  

input

${itor(6666)}
yields  
notes yields nothing due to overflow.


${rtoi(RomanNumerals)}

converts Roman Numerals back into integers.

input

${rtoi(VI)}
yields6  

input

${rtoi(emacs)}
yields1100  
notes it tries its best, don't it?

input

${rtoi(MCXVLI)}
yields1136  

input

${rtoi(MMMMMMMM)}
yields8000  
notes imperfect representation of large numbers.

   
8,698 impressions