How to write an exponential number in a constant.

0 favourites
  • 3 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I want to have a global constant that has an exponential expression like:

    c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07

    Using the Arduino plugin I am making a project that can read temperature but to make the calculations I need to put those numbers in those constants.

    This did NOT work for me:

    c1 = 1.009249522 exp(-03)

    Please some help would be very appreciated.

    Thanks

  • I want to have a global constant that has an exponential expression like:

    c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07

    c1=float("1.009249522e-03");

    or

    c2 = "1.009249522e-03"

    c3= float(c2)

    The exponential expression has to be a string and with float it is converted to a float

    Edit: I see you wrote constant

    If you define a constant you can use 1.009249522e-03 but this will converted to 0.00100925. If you need the exponential expression put it in a string and if you want the float convert the string to a float.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thank you so much Asmodean

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)