Ask your own question, for FREE!
Computer Science 13 Online
OpenStudy (anonymous):

how can i define a function which can do float divide when i input int

OpenStudy (espex):

An int will be upcast to a float automatically. The problem that you may notice is a lack of precision if you're returning a float to an int variable.

OpenStudy (anonymous):

@eSpeX but it still doesnot work can u give me a example code?

OpenStudy (e.mccormick):

In which language? Some are dynamically typed and some are not. If the language is not dynamically typed, you will need to change it to a float.

OpenStudy (espex):

The question now becomes, "What doesn't work?" An example of the code you are using will go a long way to helping others debug it.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!