How to resolve the algorithm Price fraction step by step in the PARI/GP programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Price fraction step by step in the PARI/GP programming language

Table of Contents

Problem Statement

A friend of mine runs a pharmacy.   He has a specialized function in his Dispensary application which receives a decimal value of currency and replaces it to a standard value.   This value is regulated by a government department.

Given a floating point value between   0.00   and   1.00,   rescale according to the following table:

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Price fraction step by step in the PARI/GP programming language

Source code in the pari/gp programming language

priceLookup=[6,11,16,21,26,31,41,46,51,56,61,66,71,76,81,86,91,96,101];
priceReplace=[10,18,26,32,38,44,50,54,58,62,66,70,74,78,82,86,90,94,98,100];
pf(x)={
  x*=100;
  for(i=1,19,
    if(x
  );
  "nasal demons"
};

  

You may also check:How to resolve the algorithm Write language name in 3D ASCII step by step in the BASIC programming language
You may also check:How to resolve the algorithm Semiprime step by step in the ERRE programming language
You may also check:How to resolve the algorithm Terminal control/Ringing the terminal bell step by step in the zkl programming language
You may also check:How to resolve the algorithm Self-describing numbers step by step in the Python programming language
You may also check:How to resolve the algorithm Casting out nines step by step in the FreeBASIC programming language