Large numbers calculation problem (determinant calculation)

Hello experts,
I have really interesting problem. I am calculatig determinant in ABAP with a large numbers (in CRM 5.0 system).
My formula for determinant is :
FORM calculate_determinant USING    det      TYPE zsppo_determinant
                           CHANGING value    TYPE f .
  value =
    (  1 * det-a11 * det-a22 * det-a33 * det-a44 ) + ( -1 * det-a11 * det-a22 * det-a34 * det-a43 ) +
    ( -1 * det-a11 * det-a23 * det-a32 * det-a44 ) + (  1 * det-a11 * det-a23 * det-a34 * det-a42 ) +
    ( -1 * det-a11 * det-a24 * det-a33 * det-a42 ) + (  1 * det-a11 * det-a24 * det-a32 * det-a43 ) +
    ( -1 * det-a12 * det-a21 * det-a33 * det-a44 ) + (  1 * det-a12 * det-a21 * det-a34 * det-a43 ) +
    (  1 * det-a12 * det-a23 * det-a31 * det-a44 ) + ( -1 * det-a12 * det-a23 * det-a34 * det-a41 ) +
    ( -1 * det-a12 * det-a24 * det-a31 * det-a43 ) + (  1 * det-a12 * det-a24 * det-a33 * det-a41 ) +
    (  1 * det-a13 * det-a21 * det-a32 * det-a44 ) + ( -1 * det-a13 * det-a21 * det-a34 * det-a42 ) +
    ( -1 * det-a13 * det-a22 * det-a31 * det-a44 ) + (  1 * det-a13 * det-a22 * det-a34 * det-a41 ) +
    (  1 * det-a13 * det-a24 * det-a31 * det-a42 ) + ( -1 * det-a13 * det-a24 * det-a32 * det-a41 ) +
    ( -1 * det-a14 * det-a21 * det-a32 * det-a43 ) + (  1 * det-a14 * det-a21 * det-a33 * det-a42 ) +
    (  1 * det-a14 * det-a22 * det-a31 * det-a43 ) + ( -1 * det-a14 * det-a22 * det-a33 * det-a41 ) +
    ( -1 * det-a14 * det-a23 * det-a31 * det-a42 ) + (  1 * det-a14 * det-a23 * det-a32 * det-a41 )
ENDFORM.
Det values are also f type. Problem is, that for several numbers I got the right values and for another det values I got wrong values... I also try to retype variable value on type p, but without success. Maybe I used wrong types or there is some ABAP rounding of numbers which cause wrong result.
Any good ideas of solutions. <text removed>. Thanks for your time.
Edited by: Matt on Sep 14, 2010 9:17 AM

Hi Lubos,
phew! that sounds far from SAP scope, but from Maths' numerical methods. Let's see if I can remember something about my lessons at University...
- One issue can arise when adding and subtracting terms which are very similar, because the error tends to arise quite fast. Try to add the positive terms on one hand, and the negative terms on the other hand, then subtract one from the other.
- Please take into account that the determinant value can be significantly close to zero when the condition number of the matrix is low, that is, when the range is 4 but the whole determinant is close to 0. Instead, try a [Singular Value Decomposition|http://en.wikipedia.org/wiki/SVD_(mathematics)] or an [LU decomposition|http://en.wikipedia.org/wiki/LU_decomposition]
I hope this helps. Kind regards,
Alvaro

Similar Messages

  • Export large Numbers document problem

    Trying to export this large docment, after choose the kind of export (csv,...) the "save" dialog window comes up but, sometimes, comes up also the little "export" window. I can choose folder or type the file name in the "save" window but I am not able to choose the OK or Cancel button, so I forced to use the force quit window. I let also Numbers many hours with to the little "export" window to see if it goes avay but...no way. The only thing is force quit.
    I try also cmd-dot to see if the export process stops in vain.
    Note: Number is not FREEZE. This never happens until the "iCloud" version.
    I am alone?

    OK. It seems that I am alone.
    Could someone tell me if the beolows error could be useful to understand why this semi-FREEZE happen?
    05.07.12 14:22:36.447 mdworker: (Normal) Import: mdworker type 'com.apple.iwork.numbers.sffnumbers' using 'file://localhost/Library/Spotlight/iWork.mdimporter/' exceeded time/resource use limits after 12001 milliseconds, reason:1 - find suspect file using: sudo mdutil -t 15349075
    05.07.12 14:22:53.608 mdworker: (Normal) Import: mdworker type 'com.apple.iwork.numbers.sffnumbers' using 'file://localhost/Library/Spotlight/iWork.mdimporter/' exceeded time/resource use limits after 12002 milliseconds, reason:1 - find suspect file using: sudo mdutil -t 15349075
    05.07.12 14:36:54.577 mdworker: (Normal) Import: mdworker type 'com.apple.iwork.numbers.sffnumbers' using 'file://localhost/Library/Spotlight/iWork.mdimporter/' exceeded time/resource use limits after 12000 milliseconds, reason:1 - find suspect file using: sudo mdutil -t 15355755
    05.07.12 14:37:13.737 mdworker: (Normal) Import: mdworker type 'com.apple.iwork.numbers.sffnumbers' using 'file://localhost/Library/Spotlight/iWork.mdimporter/' exceeded time/resource use limits after 12063 milliseconds, reason:1 - find suspect file using: sudo mdutil -t 15355755
    05.07.12 14:37:31.583 mdworker: (Normal) Import: mdworker type 'com.apple.iwork.numbers.sffnumbers' using 'file://localhost/Library/Spotlight/iWork.mdimporter/' exceeded time/resource use limits after 12002 milliseconds, reason:1 - find suspect file using: sudo mdutil -t 15355755
    05.07.12 14:37:48.737 mdworker: (Normal) Import: mdworker type 'com.apple.iwork.numbers.sffnumbers' using 'file://localhost/Library/Spotlight/iWork.mdimporter/' exceeded time/resource use limits after 12003 milliseconds, reason:1 - find suspect file using: sudo mdutil -t 15355755
    05.07.12 14:38:08.562 com.apple.launchd.peruser.504: ([0x0-0xc00c].com.apple.iWork.Numbers[401]) Exited: Terminated: 15
    Doing the sudo command, I know the file suspect file...and it is the file I am workning with.
    The last console line is when I do a force quit of Numbers  that is not "not responding"
    It is the *only* way to quit Numbers.

  • Problem in Calculation

    Hi Experts,
    I am doing a report on opening and closing stock with subcontractors and i am facing a problem in calculation of two fields manually.
    for eg:
    I am having MATNR  (Finished goods)  and its corresponding  MATNR (raw materials)  in another field. Each finished goods  have multiple  raw materials .
    So in my out put I am sorting the finished goods as per the raw materials.
    For finished goods am displaying  its MENGE  and for raw material  its corresponding
    STPO-MENGE  which differes for each raw material of a single finished good.
    And I am facing a problem in multiplying these different STPO-MENGE with single MENGE of finished goods.
    Please advice,
    Karthik

    Hi,
    I want to multiply finished good menge with raw material menge , both the menge are from different
    tables.
    eg - A pen is finished good and  its raw materials are top , refill etc.
    Matnr  (finished goods)  =  Pen  ,  Menge =  2 and its corresponding raw materials are:
    Raw mat1 - its Menge is  5
    Raw mat2 - its Menge is  3
    Raw mat3 - its Menge is  2.
    Now I have to multiply these whole raw mat menge with finished goods menge ie 2.
    But when I tried only the first line ie Raw mat1 is getting caluclated.
    Please advice.

  • Issue in Calculation schema determination for Scheduling Agreements

    Dear All,
      I am facing an issue in Calculation schema determination for Scheduling Agreements. The issue is -
    "Appropriate calculation schema is not being determined when a scheduling agreement is being created"
    The required settings which have been maintained are - The Calculation Schema (ZEIC31) has been created, Vendor Schema group has been created, Purchasing Organisation Schema group has been created, They both have been assigned to the Calculation schema in Schema determination, The Vendor Schema group has been assigned to the Vendor Master Record in master data creation.
    When I am creating the scheduling agreement, the system is by default choosing the calculation schema - RM0002. Thus I am not able to put the manual condition types which have been assigned in the calculation schema - ZEIC31.
    1> On what logic is the system picking that calculation schema?
    2> What settings can I do to make it pick that calculation schema only which has been assigned with POrg Sch Gp and Ve Sch Gp?
    Regards,
    Sudhanshu

    1> On what logic is the system picking that calculation schema?
    As per "Define Schema Determination" in spro Purchasing document should pick the Pricing Procedure .
    After creation of scheduling agreement have chacked your values in Scheduling agreement (Purchase ORG ,Schema grp in Vendor)
    2> What settings can I do to make it pick that calculation schema only which has been assigned with POrg Sch Gp and Ve Sch Gp?
    Check in Vendor mater is there any Plant specific Purcahsing data maintained.If it is plant specific Check purchasing data for that Plant.

  • OBIEE 11G - problem with calculating percentage

    Hi,
    I have a problem with calculating a percentage....
    I have a 2 measures Success and Failure
    where Success is a count(Response_key)
    Failure is a count(failure_key)
    I want Success/(Success+Failure) * 100
    I am getting this value as a 0
    Infact any column I take from the subject area and say count of that column and divide it by any integer say count(column1)/5 ,Say count of that column1 is 132 Eg: 132/5 , Its showing this value as 26.00 when I put decimal value to 2 , but it is 26.4...It is avoiding decimal values .
    So in my case success/(success+failure) in which Dr is greater than Nr . Since we get the value as 0.something . It is showing 0 value
    So , 0*100 it is showing me as 0%
    Can anyone please help me on this ??
    --Siri                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Yes, you need to put cast in numerator alone to get the resultant output in double.
    You can mark the post as Correct since your issue is resolved now.
    Thanks

  • Hello I have a problem in calculating the apple id Can you help me please   I forgot answer security questions for your account How can knowledge Please help Please reply as soon as possible   I can not buy from camels Store And the rest of the account ba

    Hello
    I have a problem in calculating the apple id Can you help me please
    I forgot answer security questions for your account How can knowledge
    Please help
    Please reply as soon as possible
    I can not buy from camels Store
    And the rest of the account balance  $25
    Message was edited by: lingo azam

    I think you mean App Store.
    Rescue email address and how to reset Apple ID security questions

  • Error adding large numbers

    I am adding large numbers and getting the wrong result. there seems to be some rounding taking place in the sum but i am adding integers. I am using DASYLab 9.02, data is summed in the arithmetic module, example problem 331153408-31570 = 331121838 but the output is 331121824. I tried making the variable where the inputs are stored 20 digit with 10 decimals but that did not help and i also tried dividing first by 1000 and 10000 only to get different answers. is there a setting that needs to be configured differently?

    Hi Tom, Thanks for the reply. I am reading a hex value in from a serial port. the number is large and when i format it as hex on one chan it is off by a small amount. there is some rounding in the LSD. i then take another reading later and calculate the delta. since i dont have the right values to begin with my difference calculation is wrong. when i read as bytes through 8 channels, i can see the ascii for each digit and that they are correctly displayed. using a formula module i can convert from ascii to decimal so that i get the decimal equivalent of the hex character then in the next formula i do the math to find the value of each hex digit in place it holds. then using a sum arithmetic module i get the final value of the large number coming in. it is correct all the way upto the aritmetic sum. i tried cutting the large hex number into two parts and then adding up the weighted parts and still have the wrong ans in the display module. i also tried dividing the halves by 1000 prior to adding them so that i was working with smaller numbers in the summation but that didnt help.
    so i did the math directly in the extended portion of the variables. the numbers add up properly there but when i try to bring the correct sum back into the work sheet to display it, it is wrong again. it seems that a value around 04000000 hex is the limit. below that i get the right value displayed that was calculated in the variable field, above it there is some degree of variation. I can set the limit of cycles to a value below where the addition becomes problematic or i can export the hex to a spreadsheet, do the math there and then bring it back in but i will still have the same issue displaying the answer.
    the limitation doesnt seem to be in DASYLab in general but in the Read, Formula, Constant Generator modules that read the variable back into the worksheet. it is displayed properly in the contents window

  • Store Very Large Numbers

    Hello,
    I am trying to find some info about how to store very large numbers with like 2000 digits or even more and do calculations on them.
    Does anyone have any info or links about this ??
    Thanks.

    BigDecimal?Speaking. What can I do for you?
    :)

  • Working with Large Numbers

    Hi there,
    I am currently doing a school assignment and not looking for answers but just a little guidance.
    I am working with large numbers and the modulo operator.
    I might have some numbers such as :
    int n = 221;
    int e = 5;
    int d = 77;
    int message = 84;
    int en = (int) (Math.pow(message, e) % n);
    int dn = (int) (Math.pow(en, d) % n);Would there be a better way to do this kind of calculation. The dn value should come out the same as message. But I always get something different and I think I might be losing something in the fact that an int can only hold smaller values.

    EJP wrote:
    It might make sense in some contexts to have a positive and negative infinity.
    Yes, perhaps that's a better name. Guess I was harking back to old COBOL days :-).(*)
    But the reason these things exist in FP is because the hardware can actually deliver them. That rationale doesn't apply to BIgInteger.Actually, it does. All I'm talking about is a value that compares higher or lower than any other. That could be done either by a special internal sign value (my slight preference) or by simply adding code to compareTo(), equals() and hashCode() methods that takes the two constants into account (as they already do with ZERO and ONE).
    Don't worry, I'm not holding my breath; but I have come across a few situations in which values like that would have been useful.
    Winston
    Edited by: YoungWinston on Mar 22, 2011 9:07 AM
    (*) Actually, '&plusmn;infinity' tends to suggest a valid arithmetic value, and I wasn't thinking of changing existing BigInteger/BigDecimal maths (except perhaps to throw an exception if either value is involved).

  • Business Partner records with large numbers of addresses -- Move-in issue

    Friends,
    Our recent CCS implementation (ECC6.0ehp3 & CRM2007) included the creation of some Business Partner records with large numbers of addresses.  Most of these are associated with housing authorities, large developers and large apartment complex owners.  Some of the Business Partners have over 1000 address records and one particular BP has over 6000 addresses that were migrated from our Legacy System.  We are experiencing very long run times to try to execute move in's and move out's due to the system reading the volume of addresses attached to the Business Partner.  In many cases, the system simply times out before it can execute the transaction.  SAP's suggestion is that we run a BAPI to cleanse the addresses and also to implement a BADI to prevent the creation of excess addresses. 
    Two questions surrounding the implementation of this code.  Will the BAPI to cleanse the addresses, wipe out all address records except for the standard address?  That presents an issue to ensure that the standard address on the BP record is the correct address that we will have identified as the proper mailing address.  Second question is around the BADI to prevent the creation of excess addresses.  It looks like this BADI is going to prevent the move in address from updating the standard address on the BP record which in the vast majority of cases is exactly what we would want. 
    Does anyone have any experience with this situation of excess BP addresses and how did you handle the manipulation and cleansing of the data and how do you maintain it going forward?
    Our solution is ECC6.0Ehp3 with CRM2007...latest patch level
    Specifically, SAP suggested we apply/review these notes:
    Note 1249787 - Performance problem during move-in with huge addresses
    **applied this ....did not help
    Note 861528 - Performance in move-in for partner w/ large no of addresses
    **older ISU4.7 note
    Directly from our SAP message:
    use the function module
    BAPI_BUPA_ADDRESS_REMOVE or run BAPI_ISUPARTNER_CHANGE to delete
    unnecessary business partner addresses.
    Use BAdI ISU_MOVEIN_CUSTOMIZE to avoid the creation of unnecessary
    business partner addresses (cf. note 706686) in the future for that
    business partner.
    Note 706686 - Move-in: Avoid unnecessary business partner addresses
    Does anyone have any suggestions and have you used above notes/FMs to resolve something like this?
    Thanks,
    Nick

    Nick:
    One thing to understand is that the badi and bapi are just the tools or mechanisms that will enable you to fix this situation.  You or your development team will need to define the rules under which these tools are used.  Lets take them one at a time.
    BAPI - the bapi for business partner address maintenance.  It would seem that you need to create a program which first read the partners and the addresses assigned to them and then compares these addresses to each other to find duplicate addresses.  These duplicates then can be removed provided they are not used elsewhere in the system (i.e. contract account).
    BADI - the badi for business partner address maintenance.  Here you would need to identify the particular scenarios where addresses should not be copied.  I would expect that most move-ins would meet the criteria of adding the address and changing the standard address.  But for some, i.e. landlords or housing complexes, you might not add an address because it already exists for the business partner, and you might not change the standard address because those accounts do not fall under that scenario.  This will take some thinking and design to ensure that the address add/change functions are executed under the right circumstances.
    regards,
    bill.

  • Numbers filtering problem

    Hi guys,
    I have a problem with numbers' filtering function here.
    1. I have a table of about 150 rows and 6 columns.
    2. The data consists about 42 categories and I wish to sort out each item.
    3. when I chose the column and try to filter the table, I found there list only about 22 items on the pop-up list.
    where are those missing items ?
    Could someone help me with this?
    Mike

    2. The data consists about 42 categories and I wish to sort out each item.
    3. when I chose the column and try to filter the table, I found there list only about 22 items on the pop-up list.
    Though the pop-up (or drop-down or whatever it's called) list maxes out at only 22 or so items, you can work with larger numbers in the Sort & Filter panel at the right.
    SG

  • Very Large Numbers Question

    I am a student with a question about how Java handles very large numbers. Regarding this from our teacher: "...the program produces values that
    are larger than Java can represent and the obvious way to test their size does not
    work. That means that a test that uses >= rather than < won?t work properly, and you
    will have to devise something else..." I am wondering about the semantics of that statement.
    Does Java "know" the number in order to use it in other types of mathematical expressions, or does Java "see" the value only as gibberish?
    I am waiting on a response from the teacher on whether we are allowed to use BigInteger and the like, BTW. As the given program stands, double is used. Thanks for any help understanding this issue!

    You're gonna love this one...
    package forums;
    class IntegerOverflowTesterator
      public static void main(String[] args) {
        int i = Integer.MAX_VALUE -1;
        while (i>0) {
          System.out.println("DEBUG: i="+i);
          i++;
    }You also need to handle the negative case... and that get's nasty real fast... A positive plus/times a positive may overflow, but so might a negative plus a negative.
    This is decent summary of the underlying problem http://mindprod.com/jgloss/gotchas.html#OVERFLOW.
    The POSIX specification also worth reading regarding floating point arithmetic standards... Start here http://en.wikipedia.org/wiki/POSIX I guess... and I suppose the JLS might be worth a look to http://java.sun.com/docs/books/jls/second_edition/html/typesValues.doc.html

  • Best practices for speeding up Mail with large numbers of mail?

    I have over 100,000 mails going back about 7 years in multiple accounts in dozens of folders using up nearly 3GB of disk space.
    Things are starting to drag - particularly when it comes to opening folders.
    I suspect the main problem is having large numbers of mails in those folders that are the slowest - like maybe a few thousand at a time or more.
    What are some best practices for dealing with very large amounts of mails?
    Are smart mailboxes faster to deal with? I would think they would be slower because the original emails would tend to not get filed as often, leading to even larger mailboxes. And the search time takes a lot, doesn't it?
    Are there utilities for auto-filing messages in large mailboxes to, say, divide them up by month to make the mailboxes smaller? Would that speed things up?
    Or what about moving older messages out of mail to a database where they are still searchable but not weighing down on Mail itself?
    Suggestions are welcome!
    Thanks!
    doug

    Smart mailboxes obviously cannot be any faster than real mailboxes, and storing large amounts of mail in a single mailbox is calling for trouble. Rather than organizing mail in mailboxes by month, however, what I like to do is organize it by year, with subfolders by topic for each year. You may also want to take a look at the following article:
    http://www.hawkwings.net/2006/08/21/can-mailapp-cope-with-heavy-loads/
    That said, it could be that you need to re-create the index, which you can do as follows:
    1. Quit Mail if it’s running.
    2. In the Finder, go to ~/Library/Mail/. Make a backup copy of this folder, just in case something goes wrong, e.g. by dragging it to the Desktop while holding the Option (Alt) key down. This is where all your mail is stored.
    3. Locate Envelope Index and move it to the Trash. If you see an Envelope Index-journal file there, delete it as well.
    4. Move any “IMAP-”, “Mac-”, or “Exchange-” account folders to the Trash. Note that you can do this with IMAP-type accounts because they store mail on the server and Mail can easily re-create them. DON’T trash any “POP-” account folders, as that would cause all mail stored there to be lost.
    5. Open Mail. It will tell you that your mail needs to be “imported”. Click Continue and Mail will proceed to re-create Envelope Index -- Mail says it’s “importing”, but it just re-creates the index if the mailboxes are already in Mail 2.x format.
    6. As a side effect of having removed the IMAP account folders, those accounts may be in an “offline” state now. Do Mailbox > Go Online to bring them back online.
    Note: For those not familiarized with the ~/ notation, it refers to the user’s home folder, i.e. ~/Library is the Library folder within the user’s home folder.

  • Large numbers! Need help

    I have problem. I need to do a multiplication of to large numbers(about 150 digits). But I don't know which way I could do it. Could anyone help me?
    Thanx for help.

    I can conribute a quick and dirty string multiplication function just to play with:
    - does not treat signs
    - does not treat decimals
    Just to show it can be done
    All credits to the yesterday's bad weather - made me think about "old days" (;-o)
    CREATE OR REPLACE
    function multiply_them(x in varchar2,y in varchar2) return varchar2 is
      retval varchar2(2001) := '0';
      i pls_integer;
      j pls_integer;
      half varchar2(1000);
      dble varchar2(2001);
      z varchar2(1000);
      w varchar2(1000);
    function number_is_it(x in varchar2) return boolean is
    begin
      if (x = '') or (x is null) then
        return FALSE;
      end if;
      return (replace(translate(x,'0123456789',rpad(chr(9),10,chr(9))),chr(9),'') is null);
    end;
    function odd_is_it(x in varchar2) return boolean is
    begin
      return (mod(to_number(substr(x,-1,1)),2) = 1);
    end;
    function add_them(x in varchar2,y in varchar2) return varchar2 is
      retval varchar2(1001) := '';
      z varchar2(1000);
      w varchar2(1000);
      i pls_integer;
      j pls_integer;
      carry pls_integer := 0;
    begin
      if x is null or y is null then
        return null;
      end if;
      if x = '0' then
        return y;
      end if;
      if y = '0' then
        return x;
      end if;
      i := length(x);  -- TO CALL FUNCTION ONLY ONCE
      j := length(y);
    -- FOR NOW WE JUST LEFT PAD THE SHORTER STRING WITH ZEROS TO MAKE THEIR LENGTHS EQUAL
    -- IN CASE OF BIG LENGTH DIFFERENCE TO DO:
    -- WHEN THE SHORTER STRING IS EXHAUSTED CONCATENATE THE HEAD OF THE LONGER STRING TO PARTIAL SUM OBTAINED
      if i > j then
        z := x;
        w := lpad(y,i,'0');  
      elsif i < j then
        z := lpad(x,j,'0');
        w := y;
        i := j;
      else
        z := x;
        w := y;
      end if;
      while i >= 0 loop
        if i > 0 then
          j := to_number(substr(z,i,1)) + to_number(substr(w,i,1)) + carry;
          carry := trunc(j/10,0);
          retval := to_char(j - 10 * carry) || retval;
        end if;
        i := i - 1;
      end loop;
      return to_char(carry) || retval;
    end;
    function double_it(x in varchar2) return varchar2 is
      retval varchar2(1001);
    begin
      retval := add_them(x,x);
      return ltrim(retval,'0');
    end;
    function halve_it(x in varchar2) return varchar2 is
      retval varchar2(1000) := '';
      i pls_integer := 1;
      j pls_integer := length(x);
      k number;
      carry pls_integer := 0;
    begin
      if x is null then
        return null;
      end if;
      if x = '1' then
        return '0';
      end if;
      if substr(x,1,1) = '1' then
        carry := 10;
        i := 2;
      end if;
      while j >= i loop  
        k := (to_number(substr(x,i,1)) + carry) / 2;
        if k = trunc(k,0) then
          carry := 0;
        else
          carry := 10;
        end if;
        retval := retval || to_char(trunc(k,0));
        i := i + 1;
      end loop;
      return retval;
    end;
    begin
    -- WE WILL DO "PEASANT MULTIPLICATION" (MORE EFFICIENT THAN CONVENTIONAL MULTIPLICATION):
    -- WHEN THE FACTOR TO BE HALVED IS ODD WE ADD THE CORRESPONDING DOUBLE TO THE RESULT (INITIALLY ZERO)
    -- AT EACH STEP WE HALVE ONE FACTOR AND DOUBLE THE OTHER
    -- STEPS ARE REPEATED UNTIL THE HALVED FACTOR IS GREATER THAN ZERO
      if x is null or y is null then
        return null;
      end if;
      if number_is_it(x) and number_is_it(y) then  -- THEY ARE BOTH NUMBERS
    -- CHECK FOR TRIVIAL RESULTS: MULTIPLICATION BY ZERO AND MULTIPLICATION BY ONE
        z := ltrim(x,'0');  -- TRIM LEADING ZEROS (JUST IN CASE)
        if z = '' then
          return '0';  -- SINCE ALL ZEROS WERE TRIMMED OFF X IS ZERO
        end if;
        w := ltrim(y,'0');  -- TRIM LEADING ZEROS (JUST IN CASE)
        if w = '' then
          return '0';  -- SINCE ALL ZEROS WERE TRIMMED OFF Y IS ZERO
        end if;
        if z = '1' then
          return w;
        end if;
        if w = '1' then
          return z;
        end if;
        i := length(z);  -- TO CALL FUNCTION ONLY ONCE
        j := length(w);
    -- WILL DO IT IN LESS STEPS IF THE LESSER FACTOR GETS HALVED AND THE GREATER FACTOR GETS DOUBLED
        if i > j then  -- X > Y => Y WILL BE HALVED AND X WILL BE DOUBLED
          half := w;
          dble := z; 
        elsif i < j then  -- X < Y => X WILL BE HALVED AND Y WILL BE DOUBLED
          half := z;
          dble := w;
        else  -- X AND Y ARE EQUAL LENGTH STRINGS SO WE COMPARE THE FIRST CHARACTERS
          if substr(z,1,1) <= substr(w,1,1) then  -- X < Y => X WILL BE HALVED AND Y WILL BE DOUBLED
            half := z;
            dble := w;
          else  -- X > Y => Y WILL BE HALVED AND X WILL BE DOUBLED
            half := w;
            dble := z;
          end if; 
        end if;
    -- PEASANT MULTIPLICATION
        while half > '0' loop
          if odd_is_it(half) then
            retval := add_them(retval,dble);
          end if;
          half := halve_it(half);
          dble := double_it(dble);
        end loop;
        retval := ltrim(retval,'0');
      else
        retval := 'at least one of the two operands is not a number';
      end if;
      return retval;
    end;Regards
    Etbin

  • Export cannot handle large numbers

    Exporting to TXT or CSV fails on when columns contain large numbers. I presume it uses 32 bit signed integers. The result is blanks for all fields where the contents are too large. I have tested on both win 2000 and unix with the same results.
    Eddie

    Similar problem occurs with the visualization, as mentioned in:
    acctno is null when displaying data
    Can to be that the problem with the EXPORT has the same cause of the problem with the visualization.

Maybe you are looking for