Jump to content

Implicit type conversion: Difference between revisions

Added Sidef
(Added Kotlin)
(Added Sidef)
Line 936:
1.23456789E+10
</pre>
 
=={{header|Sidef}}==
Since version 3.00, all the number types (int, rat, float and complex) are unified in the ''Number'' class and all the needed conversions are done implicitly. Methods from other classes also make implicit conversions where possible.
<lang ruby>> 1+"2" #=> 3
> "1"+2 #=> 12
> sqrt(-4) #=> 2i
> ("a" + [1,2]) #=> a[1,2]
> ('ha' * '3') #=> hahaha
> ('ha' * true) #=> ha</lang>
 
=={{header|Tcl}}==
2,747

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.