int.xml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="int" category="Built-In Types" version="3.1">
  3. <brief_description>
  4. Integer built-in type.
  5. </brief_description>
  6. <description>
  7. Integer built-in type.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <demos>
  12. </demos>
  13. <methods>
  14. <method name="int">
  15. <return type="int">
  16. </return>
  17. <argument index="0" name="from" type="bool">
  18. </argument>
  19. <description>
  20. Cast a [bool] value to an integer value, [code]int(true)[/code] will be equals to 1 and [code]int(false)[/code] will be equals to 0.
  21. </description>
  22. </method>
  23. <method name="int">
  24. <return type="int">
  25. </return>
  26. <argument index="0" name="from" type="float">
  27. </argument>
  28. <description>
  29. Cast a float value to an integer value, this method simply removes the number fractions, so for example [code]int(2.7)[/code] will be equals to 2, [code]int(.1)[/code] will be equals to 0 and [code]int(-2.7)[/code] will be equals to -2.
  30. </description>
  31. </method>
  32. <method name="int">
  33. <return type="int">
  34. </return>
  35. <argument index="0" name="from" type="String">
  36. </argument>
  37. <description>
  38. Cast a [String] value to an integer value, this method is an integer parser from a string, so calling this method with an invalid integer string will return 0, a valid string will be something like [code]'1.7'[/code]. This method will ignore all non-number characters, so calling [code]int('1e3')[/code] will return 13.
  39. </description>
  40. </method>
  41. </methods>
  42. <constants>
  43. </constants>
  44. </class>