puts "1/2 is [expr {1/2}]"puts "-1/2 is [expr {-1/2}]"puts "1/2 is [expr {1./2}]"puts "1/3 is [expr {1./3}]"puts "1/3 is [expr {double(1)/3}]"
Standard input is empty
1/2 is 0 -1/2 is -1 1/2 is 0.5 1/3 is 0.3333333333333333 1/3 is 0.3333333333333333
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!