DPF operators to reduce numerical precision

Mike.Thompson
Mike.Thompson Member, Employee Posts: 404
100 Likes 25 Answers 100 Comments Second Anniversary
✭✭✭✭

Does anybody know if DPF has operators to round, chop, or reduced to specified amount of significant figures?

The use case would be to minimize the size of data on disk if using these approximate numbers is good enough

Answers

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 508
    100 Answers 250 Likes 100 Comments Second Anniversary
    ✭✭✭✭
  • Paul Profizi
    Paul Profizi Member, Employee Posts: 14
    Second Anniversary 10 Comments 5 Likes First Answer
    ✭✭✭
    edited May 12

    Hi @Mike.Thompson, @Ayush Kumar,

    There are two answers to this question:

    Do not hesitate to detail the workflow you have in mind so we can provide further assistance.

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 404
    100 Likes 25 Answers 100 Comments Second Anniversary
    ✭✭✭✭

    @Paul Profizi , I don’t mean double vs single precision, and this does not intrinsically tie into writing files, although it could be used with that.

    The request is for operators to do any of the following:
    1. Round the numbers to specific decimal place
    2. Chop the numbers at specific decimal place. This simply removes the number is past that decimal place and does not round up or down.
    3. Change the number to a specified significant digit amount. So 456.78 at 2 significant figures becomes 460.0

    These operators should operate on a field or fields container.

  • Paul Profizi
    Paul Profizi Member, Employee Posts: 14
    Second Anniversary 10 Comments 5 Likes First Answer
    ✭✭✭

    @Mike.Thompson these are mathematical operators we currently lack but could be easy to implement. @Ayush Kumar This should be brought up as feature requests. Here we can list "round", "ceil", "floor", and "truncate", but I also see we lack "modulo" or an operator to easily switch from double to int or from int to double.

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 508
    100 Answers 250 Likes 100 Comments Second Anniversary
    ✭✭✭✭

    @Paul Profizi agreed!