Complex number calculation

Hello everyone!
I am working on this code to compute complex numbers (a+-bi) and I am a little stuck - I get an error message:
<<<invalid method declaration; return type required>>>public ComplexN( double re, double im)>>>>
Please, can anyone help me.
public class Complex {
    private double real = 0.0;
    private double imaginary = 0.0;
    public Complex() { this( 0, 0 );}
    double r = real;
    double i = imaginary;
    public ComplexN( double re,  double im) { this(re,im);}
    public Complex add( Complex a, Complex b ) { return  new Complex(a.r + b.r, a.i + b.i);}
    public Complex subtract( Complex a, Complex b ) { return new Complex(a.r - b.r, a.i - b.i);}
    public String toString() {return String.format( "(%.1f, %.1f)", real, imaginary );}
    Object[] add(Complex b) {return null;}
    Object[] subtract(Complex b) {return null;}
==================================================
public class ComplexTest
   public static void main( String args[] )
      Complex a = new Complex( 9.5, 7.7 );
      Complex b = new Complex( 1.2, 3.1 );
      System.out.printf( "a = %s\n", a );
      System.out.printf( "b = %s\n", b );
      System.out.printf( "a + b = %s\n", a.add( b ) );
      System.out.printf( "a - b = %s\n", a.subtract( b ) );
}

If you take the N off the name, you get this:
public Complex( double re,  double im) {
  this(re,im);
}OK, now walk through an instantiation like this:
Complex c = new Complex(1.0, 1.0);You call that constructor. And that constructor then delegates to the constructor that takes two double arguments. That is, it delegates to itself.
So it would just go on delegating to itself for eternity. This is bad.

Similar Messages

  • Complex SQL calculated/Group Query

    I am trying to write a complex aggregate query(s) to compile a standings table for a soccer league.
    There are four related tables:
    Matches
    Goals
    Players
    teams
    I have yet to finalize the database structure so I can add fields if necessary.
    In the goals table I track the match that the goal was scored in and which player
    scored it.
    I am trying to create a query that will give me a standings table.
    The fields I need to calculate are:
    team name
    Wins
    Loses
    Draws
    For instance:  There was a match on 4/21/2012.  The players on HomeTeam(A) scored a combined 6 goals.  The players on AwayTeam(B) scored 1 goal (All stored in the Goals table).  Therefore, Hometeam won by a score of 6-1.  I need
    a query that spits out:
    Team                Wins          Losses          Draws         
    Points
    HomeTeam(A)      1                 0                 0                
    3
    AwayTeam(B)       0                 1                 0                 3
    Wins are worth 3 Losses 0 and Draws 1 point each team.
    I am a long time SQL admin, but I think the complexity of calculating this is a little beyong me.  I need some help to get where I need to be.

    Okay, I haven't yet been able to figure out the draws because of the trouble of linking back to both teams, but here's what I have so far.
    First, here is the test data:
    Declare @tvMatches Table (
    MatchID int IDENTITY(1,1)
    ,MatchDate datetime
    ,HomeTeamID int
    ,AwayTeamID int
    Declare @tvGoals Table (
    GoalID int IDENTITY(1,1)
    ,MatchID int
    ,PlayerID int
    ,TeamID int
    Declare @tvPlayers Table (
    PlayerID int IDENTITY(1,1)
    ,TeamID int
    ,PlayerName varchar(30)
    Declare @tvTeams Table (
    TeamID int IDENTITY(1,1)
    ,TeamName varchar(20)
    Insert @tvTeams
    Select 'Winners'
    Union All
    Select 'Losers'
    Union All
    Select 'Friars'
    Union All
    Select 'Planes'
    Insert @tvPlayers
    Select 1, 'Bill'
    Union All
    Select 1, 'Jim'
    Union All
    Select 1, 'Ken'
    Union All
    Select 2, 'James'
    Union All
    Select 2, 'Smithy'
    Union All
    Select 2, 'Flip'
    Union All
    Select 3, 'Dave'
    Union All
    Select 3, 'Alan'
    Union All
    Select 3, 'Ethan'
    Union All
    Select 4, 'Naomi'
    Union All
    Select 4, 'Erland'
    Union All
    Select 4, 'Alejandro'
    Insert @tvMatches
    Select '20120101', 1, 2
    Union All
    Select '20120201', 3, 4
    Union All
    Select '20120301', 4, 1
    --Winners beat Losers 3-2
    --Planes beat Friars 4-2
    --Winners beat Planes 2-1
    Insert @tvGoals --Match, Player, Team
    Select 1, 1, 1
    Union All
    Select 1, 3, 1
    Union All
    Select 1, 5, 2
    Union All
    Select 1, 6, 2
    Union All
    Select 1, 2, 1
    Union All
    Select 2, 7, 3
    Union All
    Select 2, 8, 3
    Union All
    Select 2, 10, 4
    Union All
    Select 2, 11, 4
    Union All
    Select 2, 12, 4
    Union All
    Select 2, 11, 4
    Union All
    Select 3, 1, 1
    Union All
    Select 3, 3, 1
    Union All
    Select 3, 11, 4
    Using this test data, you want to compile the actual match outcomes.  This can be problematic to do on the fly every time though, if you have a lot of matches or teams to calculate for.  But, with a simple cte, we have:
    ;with cteMatches as
    Select m.MatchID
    ,m.MatchDate
    ,m.HomeTeamID
    ,ht.TeamName HomeTeamName
    ,m.AwayTeamID
    ,at.TeamName AwayTeamName
    ,( Select Count(1)
    From @tvGoals g
    Where g.MatchID = m.MatchID
    And g.TeamID = m.HomeTeamID
    ) HomeScore
    ,( Select Count(1)
    From @tvGoals g
    Where g.MatchID = m.MatchID
    And g.TeamID = m.AwayTeamID
    ) AwayScore
    From @tvMatches m
    join @tvTeams ht
    on m.HomeTeamID = ht.TeamID
    join @tvTeams at
    on m.AwayTeamID = at.TeamID
    ) --select * from cteMatches
    This returns the MatchID, MatchDate, team information and the score.  Basically, you have the match, team and player data tied to the goals table, so you just do a count (using correlated subqueries) to get the score of each team.  Next step is
    to calculate the winner and loser (and eventually whether there even was a winner) by comparing the scores:
    ,cteWinners as
    Select cm.MatchID
    ,cm.HomeTeamID
    ,cm.HomeTeamName
    ,cm.AwayTeamID
    ,cm.AwayTeamName
    ,Case
    When cm.HomeScore > cm.AwayScore Then cm.HomeTeamID
    When cm.HomeScore < cm.AwayScore Then cm.AwayTeamID
    Else 0
    End WinningTeamID
    ,Case
    When cm.HomeScore > cm.AwayScore Then cm.AwayTeamID
    When cm.HomeScore < cm.AwayScore Then cm.HomeTeamID
    Else 0
    End LosingTeamID
    From cteMatches cm
    ) --select * from ctewinners
    This returns MatchID, team information and the ID's for winning and losing teams.  For now it returns 0 if it's a draw.  Once we know the outcomes of all the matches, we calculate the actual win/loss for each team:
    ,cteRecords as
    Select t.TeamName
    ,Count( Case
    When cw.WinningTeamID = t.TeamID Then 1
    End
    ) Wins
    ,Count( Case
    When cw.LosingTeamID = t.TeamID Then 1
    End
    ) Losses
    From @tvTeams t
    join cteWinners cw
    on t.TeamID = cw.HomeTeamID
    or t.TeamID = cw.AwayTeamID
    Group By t.TeamName
    ) --select * from cteRecords
    That last cte returns just team name, and then the number of wins and losses for each team.  This is where I got stuck with the draws, because I'm not quite sure yet how to properly assign a draw to both teams involved.
    Now, finally you put it all together with some simple match to determine the points, and there you are:
    Select TeamName
    ,Wins
    ,Losses
    ,(Wins * 3) Points
    From cteRecords

  • Error in mapping for floating Number calculation

    Hi All,
       I have a small doubt in floating number calculation in Mapping.
    Actually i am geting a floating point number and calculating the SUM and generating the output. The input is of 2 decimal places(Ex: 26.02  and 26.03 ), but when it is adding all the values it is generating a three digit decimal number (Ex: 52.050003)
    I dont know from where it is geting one extra number "2" in the output.
    Please find the code for the same and let me know if i need to do something else to get ride of this.
       //write your code here
    float sum=0;
    if(a != null && a.length > 0.00)
       for ( int j =0; j<a.length;j++)
        sum  =  sum + Float.parseFloat(a[j]);
       result.addValue(String.valueOf(sum));
    else
    result.addValue("0");
    Thanks in Advance,
    JAY

    Jay,
    Please use the below code and let us know, if it helps.
    BigDecimal sum= new BigDecimal("0");
    BigDecimal bd;
    if(a != null && a.length > 0.00)
    for ( int j =0; j<a.length;j++)
    bd=new BigDecimal(a[j]);
    sum=sum.add(bd);
    result.addValue(""+sum+"");
    else
    result.addValue("0");
    in import section - java.math.*;
    raj.
    Edited by: Raj on Feb 18, 2008 11:11 AM

  • Method called reverse that switches complex number coordinates.

    I have written a class called "Complex" and there are no errors in the program.
    What I am confused about is how to answer an assigned question. The question
    is this: "Write a method called reverse which will return a new complex number
    with the coordinates reversed. That is, if the complex number which invokes
    the method has coordinates (a,b), then the method should return a new complex
    value with coordinates (b, a)."
    I will include my code for the class here (I'm using the NetBeans IDE):
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package tutorial8;
    * @author Aleks
    public class Complex
        private int I; // Real Part
        private int J; // Imaginary Part
        public Complex(int I, int J)
        setComplex(I, J);
    public int getI()
        return I;
    public int getJ()
        return J;
    public void setComplex(int I, int J)
    this.I=I;
    this.J=J;
    if (I==J)
    System.out.println("true");
    else
    System.out.println("false");
    }thanks.

    Your right it compiles without errors but it says it's missing a main method.
    This main method thing is driving me insane. Some of my classes work such as the following
    one:
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package tutorial7;
    * @author Aleks
    import java.util.Scanner;
    public class Shortcalculation
        public static void main(String[] args)
            Scanner keyboard = new Scanner(System.in);
            System.out.println("Enter a positive integer");
            int positiveInteger = keyboard.nextInt();
           if (positiveInteger < 2)
            System.out.println("First positive integer output");
            positiveInteger = 4;
            while ((positiveInteger/3 >=1) && (positiveInteger/3 < 2))
                System.out.println("4");
            else if (positiveInteger < 3)
            System.out.println("Second positive integer output");
            positiveInteger = 21;
            while ((positiveInteger/5 >=2) && (positiveInteger/5 < 3))
                System.out.println("21");
            else if (positiveInteger < 4)
            System.out.println("Third positive integer output");
            positiveInteger = 43;
            while (positiveInteger/7 <=3)
                System.out.println("43");
            else
            System.out.println("Not a valid integer");
    }But I don't see why THIS one shouldn't. I try to include a "public static void main(string[] args)"
    in the class complex but it says it's an illegal start of the expression. Maybe it depends on
    where in the class I put it. I'm only practicing writing classes for 3-4 weeks now because I've read
    a lot of the book. Too bad my memory is kind of bad. Ok, I have changed the class for this
    question, I have added a reverse method. I did it without a return statement.
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package tutorial8;
    * @author Aleks
    public class Complex {
        private int I; // Real Part
        private int J; // Imaginary Part
        public Complex(int I, int J)
        setComplex(I, J);
        public int getI()
        return I;
    public int getJ()
        return J;
    public void setComplex(int I, int J)
    this.I=I;
    this.J=J;
    if (I==J)
    System.out.println("true");
    else
    System.out.println("false");
    public void reverse()
    this.I=J;
    this.J=I;
    }sorry for the long post.

  • Java number calculation.

    hi, i am doing java encryption/decryption and my key is 128 bits. i need to times multiple keys and thus, the value is far exceed the integer and long value.
    thus i decide to use math.biginteger.
    however, the calculation is weird.
    here is my code
    BigInteger biPdi = new BigInteger(bPdi); //bPdi is a bytearray
    BigInteger biKey = new BigInteger(groupKey);//group key is a bytearray
    BigInteger bicKey = new BigInteger(bicGroupKey));//bicgroupkey is a bytearray
    System.out.println("derivationkey: " + biPdi.toString(16));
    System.out.println("child group key: " + bicKey.toString(16));
    b = biPdi.add(bicKey).toByteArray();     
    BigInteger bit2 = new BigInteger(b);
    System.out.println("derivationkey: " + bit2.toString(16));
    this is the result i am getting back.
    derivationkey: 30
    child group key: 3938393951128f27c3da559f36ea62de
    derivationkey: 3938393951128f27c3da559f36ea630e
    i know the derivationkey has value "0" which is encode as "30" b/c it is based on 16. thus, the byte value is "48" which is the value of "0".
    when i add derviationkey with child group key, i expect to my new diviationkey is same as childgroup key b/c it is childgroup plus 0. however, i am getting a different value. i think the reason is because java byte array try to add 30 to childgroup.
    in this case, how can i do a large number calculation? can someone give me any advice??
    Thanks in advance.

    There's a button what says "code." Hit it and put your code inside the tags.
    i know the derivationkey has value "0" which is
    encode as "30" b/c it is based on 16. thus, the byte
    value is "48" which is the value of "0".0 is zero no matter what the base. And 48 != 0 no matter how much paint you sniff (though it can seem that way).
    when i add derviationkey with child group key, i
    expect to my new diviationkey is same as childgroup
    key b/c it is childgroup plus 0. however, i am
    getting a different value. i think the reason is
    because java byte array try to add 30 to childgroup.If it's 30 and you add it, the answer will come out as 30 more than the number you added to 30.
    in this case, how can i do a large number
    calculation? can someone give me any advice??BigInteger works like it should. derivationkey is 30.
    ~Cheers

  • How to convert waveform into complex number

    Hi,
    I need to convert the acquired voltage and current waveform through DAQ card into complex numbers in order to find the phase relationship
    between the waveform.Can u tell me is there any method to convert the acquired waveform into complex number array
    or is there any other method to find the phase??
    please help me in this
    Regards
    Meenatchi

    Dear Meenatchi,
    I am attaching two sample VI s for the issue you are facing. Hope this helps.
    The waveform in array format.vi gives you the values of the waveform obtained from your DAQ card in an array directly. You can choose this mode by selecting it from the options available on the DAQmx read vi. But if you still want to extract the array from the waveform data type please navigate to programming >> waveform >> get waveform components and extract the array component.
    The phase of the complex number created.vi gives you and array of the phases. Please specify the number of iterations of the for loop that determines the size of the array.
    If you need any further assistance, please feel free to contact us.
    Regards,
    Pavan Ramesh
    Applications Engineer
    NI India
    Attachments:
    Waveform array issue.zip ‏10 KB

  • Week number calculations not working ...

    Why doesn the week number calculation (ISO 8601) using datepart ('ww',#date#,crMonday,crFirstFourDays) not work?
    As an example do the following formula:
    DatePart('ww',CDate(2005,1,1),crMonday,crFirstFourDays)
    The result is 9363, quite an impressive week number
    This is an issue in versions 2008, XI R2, XI, 10 and possibly previous versions too

    Hi Raghavendra
    No I want to be able to calculate week number according to the week numbering definition from ISO 8601 - have a look at [http://en.wikipedia.org/wiki/ISO_week_date|http://en.wikipedia.org/wiki/ISO_week_date]
    If you want to use datepart ('ww, ... to solve this,
    you have to specify crMonday as third argument and crFirstFourDays as argument number 4 to tell datepart that weeks starts on mondays and week #1 is the one with the first 4 days of the year.
    Doing this makes my example date  used with datepart returns the week number 9363!!
    The DatePart('ww',CDate(2005,1,1),crMonday,crFirstFourDays) is supposed to return 53!!
    Weeknumbers are supposed to be between 1 and 52 or 53 depending of the year.
    Be aware weeks number 1, 52 and 53 very often contains days from 2 consequtive years, when defined according to ISO 8691.
    Your suggestion does not take into account the fact Weeks start on mondays and january 1st is not always the first day of week 1.
    It returns week number 1
    In fact it seems every day in the start of a year with weeknumber starting in the previous year gets the weeknumber calculated wrong.
    Regards,
    Poul
    Do you want to calculate the weeknumber of a particular date? If so please try datepart('ww',CDate(2005,1,1)).
    If not could you please explain me what you are trying to calculate and what output you are expecting?
    Regards,
    Raghavendra

  • Restrict Automatic serial number calculation for Production order release

    Hi,
    I need the solution for following requirement.
    Release production order(CO02) . Then go to Menu header-> Serial Numbers.
    Here I am getting serial numbers automatically as the material used in production order is set for automatic serial number calculation.
    But I want to restrict automatic serial number assignment based on production order type.
    If order type is 'XYZ', I dont want to calculate serial numbers automatically.
    Can anyone tell me how to do it?
    Regards,
    Manan Desai.

    When you press Release Order button the BADI 'WORKORDER_UPDATE->AT_RELEASE' will be called.
    At this point the internal tables for Serial numbers are filled by the program automatically.
    So call function module 'SERIAL_INTTAB_REFRESH' which will refresh the internal tables for serial numbers generated before teh serial number window pops up.
    Also at the BADI 'WORKORDER_UPDATE->AT_SAVE' call the same function module because before this BADI call when you press 'SAVE' the program again checks if automatic serial number is set for that material and if yes then check if no serial numbers are generated then it generates the serial numbers again and fills the internal tables. So clear the internal tables again based on the conditions.
    In these BADI's we have access of header information which can be used to check condition.
    I hope this will give you better idea.
    Thanks for your efforts.
    Manan Desai.

  • Multiply a digital signal by a complex number

    I am using a 7811R FPGA module on a 1042Q chassis; I have an ADC board connected and delivering 8 separate streams of data to the DIO lines of the FPGA module.  The data is collected in the FPGA VI and than transfered to a Host VI for further data processing.
    I am trying to implement a digital beamformer for an antenna array; for that purpose I need to multiply the 8 data streams by a weight (complex number with amplitude and phase).  I can't quite grasp how I would multiply a digital data stream by a complex number!
    Would I have to collect a sequence of 8 data points and use them as one number?  What kind of data should I use for complex number multiplication? 
    Any other considerations I am not taking into account that you know of?
    Thanks in advance.

    You could convert booleans to zero to one and then multiply. But I can't think of anything you can DO with this.
    You need to think about what is going on physically. What do the data
    streams represent? What mathematical operations do you want to perform?
    Thinking about beamforming: crudely speaking, you want to delay the
    various signals by different time increments and then add them
    together.

  • Spreadsheet structure - complex cost calculation

    I am trying to set up a semi-automatic spreadsheet that will help me prepare quotes for building work.
    I would appreciate any advice on the best set up that would for this and possible functions I would need to use to make it work. I tried finding a suitable solution or a template but to no avail.
    I'll try to explain the requirements as clearly as I can, but please let me know if there is any further explanation you may require.
    1. I have many tables that I set up to calculate costs and prices of particular types of work, i.e. building a brick wall or laying foundations
    1.1 Each table has the same columns such as'type of resource', 'quantity', 'price per unit', 'cost', 'profit', 'price'
    1.2 Each table has a different number of rows, depending on number of resources required for the particular type of work, some of the tables have multiple header rows to allow for data entry cells, such as 'length' or 'height'
    1.3 I keep the tables in a separate file and just copy the ones I need for particular quote, one type of table may be used several times in a quote, depending on type of job quoted, i.e. I may have more than one wall to price
    2. The main sheet of the quote has a table that lists all the items of work I need to price
    2.1 The columns are: 'item id' (unique number), 'item description' and 'tender price'
    2.2 'tender price' is manually linked to 'total price' in the relevant calculation table (I gathered here that perhaps using INDIRECT function will allow the link to be automatic, correct?)
    2.3 Right now I use 'item id' as the name of the relevant table to be able to recognise which item it calculates
    3.0 I need a summary sheet with few tables that will give me various information. The information required is:
    - materials list and quantities collected from all the calculation tables
    - labour list as above
    - labour and materials per build stage (I need to add stages to the tables first)
    I'm not sure this can work with me using separate tables for each item calculation. I think that if I put all the calculations into one, big table I may be able to pull info out by using categories, however I would like to avoid this as I would end up with very large, messy tables on larger quotes.
    I have used excel and a combination of outline and pivot tables in the past, but it was by no means a perfect solution.
    I hope my explanation is clear and I do appreciate your help.
    Regards
    Bart

    Bart,
    I think I have what you were looking for. I only addressed what I thought was your concern.
    1. I added a table to your "general calculators" sheet, and called it "Data"
    2. I utilized the VLOOKUP and the INDIRECT functions to make your Totals more dynamic.
    3. The formula is going to look to the table referenced in the "A" column of the line. (A3 = 1.1)
    4. The formula will then look at the column heading and find the number in the "Data" table I added.
    5. The lookup will then go over this many columns to find the value of the "Total" line.
    You should be able to copy this formula to all the cells you are looking for the total of. As an example, copy cell C3 to C12. Then range fill to F22. Delete the formulas in C16 and D16 as they will error, because they are not necessary. Repeat the procedure for Job 3, etc.
    If you change the Job (Table) reference in column "A" this will automatically look to the correct table. If you need to add a column some day, Add the column to all the appropriate tables, then add the name and column number to "Data." It should then recalculate correctly.
    I have posted the spreadsheet here:
    https://www.iwork.com/r/?d=samplequoteRevised.numbers&a=p108776228
    If it you cant get to it, let me know....and we can try something else...since I dont have a mobileme account.
    Let me know if you have ANY questions.
    Waza

  • Complex number formats in graphs

    Hi,
    At the moment I try to figure out, if the following is possible or not at all.
    I have a numeric object which holds a number of seconds. For each day (date) there is such an object.
    So, I just want to create a graph showing the days (x-axis) and the respective seconds (y-axis). So far, no problem at all.
    But, for readability it is necessary to show the seconds in a more suitable way - namely as minutes and seconds [mm:ss].
    Now, I could easily transform the seconds (number) into something like 'mm:ss' using an additional variable - which must be text then. Such text cannot be used as values for the y-axis.
    So, I tried to create a user defined format for the output in the graph, but I couldn't find any way to define such a complex format which allows me to show mm:ss as values for the x-axis.
    Just an example graph...
    01:00-|----
    00:50-|----
    00:40-|---||-----
              01.01.2010  02.01.2010
    Does anybody know, if or how this idea could be implemented through any means of the Webi and/or Designer? Simply displaying seconds is not accepted by the management.
    Many thanks for any hint
    Matthias

    Hi,
    You have to create measure to convert time diff in sec to HH:MM:SS format.
    Measure1 = Time diff in seconds
    Hours = Measure1/ 3600
    Minutes = (Measure1 - hour*3600) / 60
    Seconds = (Measure1 - hour3600 - Minutes60)
    Concatinate all three measure created above and you will have the measure you wanted.
    Hope this will help you.
    Cheers,
    Ravichandra K

  • Cust  for Item number calculation when creating/changing a sales orders

    Hi
      I need to know if the item number when capturing/ modifying  a sales order can be calculated automatically with some route in the customizing,  or do I need to do it with some user exit in the sales order entry?.
    Thanks!
    Regards
    Soraya

    Hi,
    Goto the T.Code "VOV8".
    Select your order type.Details.
    Goto the "Number systems" tab.
    Maintain the value as "10" or "15" like this any number as per your requirement for the field "Item no.increment".
    So that the main item will be incremented by the number you specified here.Suppose you specified the number as "10" the line item numbers would be 10,20,30,.....
    Next is if you maintain the value for the field "Sub-item increment" then the sub items will be incremented by the number you specified here.
    It would be mainly used in the case of BOM.
    To get the numbers from the order,goto the T.Code "SE11/SE16".
    Enter the table name as "VBAP".
    Pass the order number.Execute.
    You will get the all line items with numbers.
    Regards,
    Krishna.

  • Complex PCR calculation - Reg

    Hi Gurus,
    Please go through the following PCR with input & output tables and explain the calculation. What to do to get the proposed value.
    IT
    /092 -   Rate: 12.07
    WT X000 OT 1.5 rate- Number: 45.00
          Z015      3            AMT?0
          Z015      3   =        NUM?0
          Z015      3   = *      RTE?0
          Z015      3   = * =    VALBS?
          Z015      3   = * = X  GCY Z115*
          Z115      *           VAKEYALZNR
          Z115      *   N        VWTCL 18
          Z115      *   N *      GCY ZZ15
          ZZ15      *            WGTYP?
          ZZ15      *   ****     VALBS0
          ZZ15      *   ****     ADDNA *
          ZZ15      *   ****     FILLF N
          ZZ15      *   ****     WGTYP=*
          ZZ15      *   ****     VALBS1
          ZZ15      *   ****     NEXTR A
          ZZ15      *   ****     ADDNA *
          ZZ15      *   ****     FILLF N
          ZZ15      *   ****     WGTYP=*
          ZZ15      *   ****     VALBS2
          ZZ15      *   ****     ADDNA *
    OT
    WT X000   Rate: 18.11 Number: 45.00 Amt 814.95
    Supposed formula here is: 12.07 * 45.00 * 1.5 =  814.725 ( Proposed Value )
    Plese explain the above PCR calculation.

    Hi Remi,
    Thank you for your answer.
    Q. As for processing of your WT X000, what are it's Valuation Bases in V_512W_B ?
    - it is valuated in current wagetype and Valuation basis 092 and rate is 150%. 
    Q. Have you checked through pe04 what is operation VAKEYALZNR ? Isn't it related to Alternative Payment ?
      yes, it is alternative payment.
    P.S. : 12.07 x 1.5 = 18.105, which will give 18.11 once it is rounded up.
    A: we never used any round up function,
    Though we not used the roundup function why it is rounded up. How and where can we remove this roundup.
    Thank you for your help.
    Rgds
    -AADI

  • Need help on complex math calculation in labview

    I need some help by being pointed in the right direction.  I have a piece of old lab equipment that I will be connecting to labview.  In order to send commands to the hardware, I have to calculate a checksum.  The checksum algorythm requires me to take alphanumeric characters, convert them to binary, perform binary addition, perform an Xor, mask certain digits, and convert the resultant binary string back to an ascii character.  Does labview have the capabilities to do this on it's own, or should I look at connecting to something like an external dll? 
    I have Visual Studio 2008 and some previous VB experience, so I think I could write a program that would do the calculation, but don't really know exactly what type of project (dll, etc.) is best.  Are there any specific settings for the dll so that labview can use it.  I see an example for C++ for Visual Studio 2005, but that is as close as I can get.  I only know VB, not C# or C++
    Can someone please point me in the right direction?
    Tron
    Solved!
    Go to Solution.

    You basically need some logical shifts and ANDs.
    Check version 2.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV
    Attachments:
    Checksum ver 2.vi ‏10 KB

  • Formula Question: How can I get an 'IF' statement to return a positive if the number calculated is within one number of the desired value?

    Numbers 2.0 running on Mountain Lion 10.8.5

    Hi hi.charles,
    this should work
    D5 your calculated value
    D6 desired value
    IF(AND(D6≤(D5+1),D6≥(D5−1)),TRUE,FALSE)
    quinn
    quinn

Maybe you are looking for