I’m new to SML, and am using the SMLNJ dialect.
For some purpose I have been trying to typecast 3 to 3.0 (int to real).
Could not find a way out. How can I do this? How can I convert between types?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the function
real(orReal.fromInt) to convert anintto areal.For further information you can see a list of functions available in the Top-level environment here and an overview of the Basis library here.