LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Need some help with mod function

    Employee
    Posted 06-26-2014 03:13

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Wizardous

    Hi,

    I need to use mod() function with double value type cause I have numbers with 20+ digits and can not convert them long. Or do I need any other solution?

    For example If there is a filter like I typed below (Assume, "e" is an input field with that kind of numbers in it); than "a" variable will not give the correct output.

    e=756843683586257354274
    a=mod(e,67)
    emit a,e


    Any idea would be helpful.

    Thank you,

    �zg�n


  • 2.  RE: Need some help with mod function

    Employee
    Posted 06-26-2014 06:36

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: johnpelz

    Hi �zg�n,

    The current mod() function doesn't support double values - it only works with integers / long value types in BRAINScript. See below for the value type definitions in BRAINScript (also in BRAINScript help under "General Language Sections" -> "Value Types"

    int : Signed integer. Valid range of values is from -2^31 to 2^31 - 1.
    long : 64-bit signed integer. Valid range of values is from -2^63 to 2^63 - 1.

    I have filed an enhancement request with our engineers to add a fmod() function (c++ equivalent) but I cannot make any promises on when this will make it into the product.

    I would suggest looking into using the Python or Java nodes, assuming they have a function available.

    Hope that helps.


  • 3.  RE: Need some help with mod function

    Employee
    Posted 07-02-2014 04:51

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Wizardous

    Hi John,

    Thank you. I used python to get mod of a string and it helped.

    Regards,

    �zg�n