% set a 10.0
10.0
% set b 3.0
3.0
% puts "[expr {$a % $b}]"
can't use floating-point value as operand of "%"
I am getting the above error is there any way to do it in tcl.
tcl comes with a built in fmod
math function that can be used with expr
or as a standalone:
set a 10.0
set b 3.0
puts [expr {fmod($a, $b)}]
puts [::tcl::mathfunc::fmod $a $b]