float.xml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="float" category="Built-In Types" version="3.0.alpha.custom_build">
  3. <brief_description>
  4. Float built-in type
  5. </brief_description>
  6. <description>
  7. Float built-in type.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <demos>
  12. </demos>
  13. <methods>
  14. <method name="float">
  15. <return type="float">
  16. </return>
  17. <argument index="0" name="from" type="bool">
  18. </argument>
  19. <description>
  20. Cast a [bool] value to a floating point value, [code]float(true)[/code] will be equals to 1.0 and [code]float(false)[/code] will be equals to 0.0.
  21. </description>
  22. </method>
  23. <method name="float">
  24. <return type="float">
  25. </return>
  26. <argument index="0" name="from" type="int">
  27. </argument>
  28. <description>
  29. Cast an [int] value to a floating point value, [code]float(1)[/code] will be equals to 1.0.
  30. </description>
  31. </method>
  32. <method name="float">
  33. <return type="float">
  34. </return>
  35. <argument index="0" name="from" type="String">
  36. </argument>
  37. <description>
  38. Cast a [String] value to a floating point value. This method accepts float value strings like [code] '1.23' [/code] and exponential notation strings for its parameter so calling [code] float('1e3') [/code] will return 1000.0 and calling [code] float('1e-3') [/code] will return -0.001.
  39. </description>
  40. </method>
  41. </methods>
  42. <constants>
  43. </constants>
  44. </class>