Float calculation in VS2010 and VS2012/VS2013 C++

Hi,
There are some difference in float calculation in VS2010 and VS2013/VS2012.   (vc++)
VS2010 by default uses FPU instruction for float calculation. while VS2013 by default , uses SSE2 instruction for the same.
Can you suggest which is the most accurate result. FPU or SSE2
Regards,
Alphonse

That tends to depend on the code you write. Without being a floating point expert I'll say that I find SSE2 preferable because it provides consistent results. Consistency isn't the same thing as accuracy but it's usually more valuable.
Consider the following example adapted from "What Every Computer Scientist Should Know About Floating-Point Arithmetic" (required reading if you really care about
floating point accuracy):
void test(float a, float b) {
float q = a / b;
if (q == a / b)
printf("Equal\n");
else
printf("Not Equal\n");
int main() {
test(3, 7);
This code prints "Not Equal" when FPU is used and "Equal" when SSE2 is used. Needless to say, the SSE2 result is much more desirable.
The reason for this is that FPU tends to perform calculations at a higher precision than requested. The VC++ runtime configures the FPU to use double precision and as a result all float calculations are actually done at double precision and the result
is converted to float when required by the code (like when storing into a float variable). In the above example the right side of == will be a double precision value while the left side is a double precision value that was previously rounded to single precision.
If you use only doubles it's less likely to run into such issues but as far as I can tell it's not completely impossible. The FPU rounds only the mantissa part to double precision but leaves the exponent alone. Presumable this can cause issues if very
large values are involved.
SSE2 doesn't suffer from this problem, it has distinct instructions for single and double precision and VS2013 makes use of them. If you use floats the calculation is done using single precision, if you use doubles the calculation is done using double precision; nothing
less, nothing more.

Similar Messages

  • Custom Report Items in VS2010 or VS2012 ? Does it work

    Does anyone know if Custom Report Items actually work in either VS2010 or VS2012.
    I have taken the 2008R2 Polygons sample and compiled it using VS2010 and VS2012 and neither actually work in either version.
    There are no assembly linking errors, but the compiled dlls either can't be added to the toolbox in VS2012 or can't load the type in VS2010.
    I have tried everything and was interested if Microsoft had been able to get it working them selves.
    My next step is to write my own, but was wondering if it actually works before I try.
    Jamie

    Just fixed this myself.
    It appears the documentation online is wrong and the sample code is missing a reference to a reporting services dll and an attribute.
    What you need to do to get it working in VS2012 is add a reference to: Microsoft.ReportingServices.designer.11.0.dll to the PolygonsDesigner project and then add the following attribute to the PolygonsDesigner class: [ToolboxItem(typeof(Microsoft.ReportDesigner.Shell.CRIToolboxItem))]
    I also removed the [System.CLSCompliant(false)] attribute.
    You then recompile and place both dlls in C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies directory and the PolygonsDesigner.dll into the C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer\bin
    or what ever is you reporting services path.
    You also need to change the Microsoft example for the rereportserver.config file to:
        <ReportItemDesigner>
       <ReportItem Name="Polygons" Type="Microsoft.Samples.ReportingServices.PolygonsDesigner, PolygonsDesigner" />
        </ReportItemDesigner>
        <ReportItems>
       <ReportItem Name="Polygons" Type="Microsoft.Samples.ReportingServices.PolygonsCRI,PolygonsCRI"/>
        </ReportItems>
     Notice that I changed the namespaces and class to what is in the actual code so if you change it make sure you change it here.
    And here in the RSReportDesigner.config:
    <ReportItems>
          <ReportItem Name="Polygons" Type="Microsoft.Samples.ReportingServices.PolygonsCustomReportItem,PolygonsCRI" />
        </ReportItems>
        <ReportItemDesigner>
          <ReportItem Name="Polygons" Type="Microsoft.Samples.ReportingServices.PolygonsDesigner, PolygonsDesigner" />
        </ReportItemDesigner>
        <ReportItemConverter>
          <Converter Source="Chart" Target="Polygons" Type="PolygonsCRI.PolygonsConverter, PolygonsDesigner" />
        </ReportItemConverter>
    Notice I haven't changed the last part as I didn't know what the PolygonsCRI.PolygonsConverter was.
    And make sure the rssrvpolicy.config looks like this:
         <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust" Description="This code group grants PolygonsCRI.dll FullTrust permission. ">
           <IMembershipCondition class="UrlMembershipCondition" version="1" Url="C:\Program Files\Microsoft SQL Server\MSRS10_50.SQLSERVER\Reporting Services\ReportServer\bin\PolygonsCRI.dll" />
        </CodeGroup>
    After a restart of ssrs and relaunch of VS2012 I opened a test project and added the PolygonsDesigner.dll to the toolbox and it works.
    Jamie

  • Same Workspace for VS2010 and VS2013?

    Howdy,
    I'm setting up TFS on a system and it appears that you can't have two version of Visual Studio map to the same directory on your local system.  I already have VS 2013 mapped to a local path.  When I go into Visual Studio 2010, connect to the TFS
    server and then try to map the path I get the message:
    The working folder "C:\..." is already in use by the workspace ComputerName;UserName on computer ComputerName.
    This doesn't make sense to me.  I can't have all my source in one local folder?  Won't this end up with duplicate copies of everything that is in the repository on my local hard drive?  Am I missing something here?
    Thanks
    dbl

    Hi,
    VS 2010 can't use "local" workspaces. That was a new feature in VS 2012. You can create a workspace in VS 2013 and set the location property to "server". Then this workspace can be used in VS2010 and VS2013.
    Follow the steps in this screenshot:
    More information about "decide between local and server workspace":
    https://msdn.microsoft.com/en-us/library/bb892960.aspx
    Maik Hanns
    MCT, MCPD, MCSD
    http://blog.maikhanns.de

  • Is there a floating calculator for the mac

    I would like my desktop calculator to follow me when I change windows. I call this a floating calculator but perhaps there is a different name for this. Is one available for download into Mountain Lion
    Thank Bruce

    The Apple Support Communities are an international user to user technical support forum. As a man from Mexico, Spanish is my native tongue. I do not speak English very well, however, I do write in English with the aid of the Mac OS X spelling and grammar checks. I also live in a culture perhaps very very different from your own. When offering advice in the ASC, my comments are not meant to be anything more than helpful and certainly not to be taken as insults.
    You can have the Calculator app appear in all Desktops. Open the app, right click the app's icon in the Dock and choose Options/All Desktops. However, Fullscreen apps are not treated as desktops and the app will not follow you to an open FS app.

  • What is the use of Alternative Calculation Type =2 and 4

    Dear Friends
    In pricing procedure in gross value, Net value for Item and Net value has Alternative calucation type is 2.
    What is the use of it?
    Without using it these value line are also fetching net value then what is the work of it. Please give me detail information with its effects in pricing condition tab page in sales document.
    Thanking You
    Arun

    Arun biswal,
    Correct Biswal. We have at varoius stages within Pricing procedure the "net value" which is calculated. Not only the alternative calculation type "2" is used if you notice carefully they are stored as subtotals at various levels.
    For Ex Gross Value  --> Subtotal =1 --> Calc type = 2
    similarly for Net value for Item --> Subtotal =2 --> Calc type = 2
    Net value 2 --> Subtotal =3 --> Calc type = 2
    See, these are used to calculate the net value at various levels in pricing. The calculation Type has got a set of routines that will facilitate us in pricing. SAP has provided certain clauclated formulas or routines to facilitate us during calculation within pricing . Here the "2" is used for calculation without tax and store it as subtotal and display it or use it for further calculations.
    We can use this "netvalue" amount for further calculations. It is used for clarity purpose when you issue a statement to customer. (like Confirmation order) at various levels like discount amt involved, Freight involved, Rebate amount invloved.....
    Even without this Calc type or using sub total u can proceed....
    Finally we have  TOTAL  --> Subtotal =A --> Calc type = 4
    In the above line we have Calc type as 4, which means when you use TAX this calc type is used .
    Routines are used to facilitate your process....
    Regards
    Sathya

  • Calculation of depreciation and interest for a particular asset class

    Hi,
    I have a problem with the calculation of depreciation and interest for a particular asset class. The assets are financial leases. The depreciation key defined is LEAS. The following are the attributes of this key:
    Dep/int             phase     base met dec-bal prd cont mult lvl chn ov
    Ord.depreciation     1     0011     001     006     001        5
    Ord.depreciation     2     0002     001     003     003
    Interest             1     0028     001     003     010
    An example of an asset is:
    Aquisition value: 1041552.71 (as migrated on 01.04.2007)
    Ordinary dep already posted: 56243.88
    Net book value: 985308.83
    Scrap Value:729086.90
    Useful life: 50 years
    Expired useful life: 9 years 1 month
    Remaining useful life: 40 years 11 months.
    Depreciation start date: 28.03.1998
    Interest calculation start date:30.03.1997
    Depreciation calculated by the system:6261.83
    Interest calculated in the year:15682.68
    I'm not able to undersatnd on what basis the system calculated the interest. I will be thankful if anyone can help me resolve this. An early reply will be greatly appreciated as I'm facing major problems due to this issue.

    Hi Mahesh,
    As per my analysis of the case the interest rates are as under
    Acq. Year                                                    Int.Percent
    9999     4          01     10.%
    9999     7          01     5.%
    9999     25          01     2.5%
    9999     999     12     01     2.5%
    As per this the Acquisition value less the Scrap Value Rs.312,465.00 @ 2.5% p.a will be Rs. 7811.64.
    Based on the above you analyse for which period interest is calculated.
    Hope it will help.
    Regards,
    Vijay

  • Witholding Tax calculation while payment and advance

    Dear experts,
    I have few questions as below. It would be great if you can help me out in this :
    In vendor master I have two WTH tax codes for invoice and payment and marked as liable.
    Incase of invoice (FB60) posting system is calcu;ating correctly and posting, but while posting no popup for to rectify the WTX code also no base amount is populating in WTH tax tab of invoice posting. Is this correct way??
    While making payment for the same invoice through F-53, system is again calculating on same open item and no popup, until I go to WTH tax tab and delete the tax amount. What is lacking in my customising of WTH tax code (payment type), to restrict WTH tax calcutaing twice ??
    While making advance payment by F-48, system not calculating WTX tax and showing tax code is mandatory, even though tax code  (V0-tax exempt) entered, no WTH tax calculation happening. I have checked all Field status of document type and recon account, nothing is mandatory. I dint know why?? Please help in this regard.
    Thanks in advance.
    Regards
    Abhi

    Hi madhu
    Thanks for explaining the process it works.
    Regarding the error I was facing earlier to enter the tax code in F-48 for the tax category was marked as ' * ' in the advance reconciliation GL. I have removed them and now the error is not coming.
    But now for the same or advance payment with F-48, I am not able post the document, though the payment WTX code is showing but not calculating the amount for the same.
    The error is
    "Withholding tax amount exceeds total bank line item amounts."
    Message no. 7Q320
    How to post it. Please help.
    Regards
    Abhi

  • Need Help in Calculation of Paid and Unpaid Break in Daily Work Schedule

    hai,
    I am a student of SAP-HCM. I am having problem with the calculation
    in Paid and Unpaid Break in Daily work schedule (Time Management).
    Please help.
    thank you
    Dev.

    Hi,
    The above screen shot is table where we maintain unpaid and paid breaks, we mention about when a break has to start under START tab and when it has to end under END button.
    Under UNPAID and PAID tabs we mention duration of break,  if its 15 mins break or half an hour or one hour depending on start and end timings.
    Suppose a shift is for 9 hours in total and client wants there should be a paid break of one hour, then out of this 9 hours shift itself  break would be considered.... and in case client wants unpaid break then shift would be for 10 hours out of which 9 hours will be working hours and one hour break.
    When this concept has to be calculated in schema processing type would be assigned to this time pair showing break accordingly either paid or unpaid.

  • ITEM INTEREST CALCULATION ON VENDOR AND CUSTOMER

    Dear all,
    how to calculate Item interest calculation on Vendors and customers
    what is the configuration need? please let me know it is very needful for me
    Thanks in advance.
    Regards,
      Ram.

    in ob46 we maintain int calculation types under that u can maitain int indicatro name int calculation type(P)and save
    after that u can prepare itme balance interest calculation(path spro/f/a/ap&ar/business transactions/int calculation/int calculation global settings/prepare item int calculation) here
    u can enter int indicator select open itmes check box enter calander type etc.
    define referance itn rates obac here u can enter ref int rate long text short text date from currency and save
    define time dependent terms ob81 here u can enter int indicator currency effective from sequential number term(u can select item int calculation) ref address rate etc.
    enter int values ob83 here u can enter reference int indicator from date and percentage save.
    if u have any doubt let me know.

  • Tax Calculation in MM and SD

    HI
    I am little bit confused in Tax Calculation in MM and SD . Please see the scenario below
    In my current project in MM side we maintain Base price , discounts and other MM related conditions using MEK1 and for Tax related conditions we use FV11
    So we use Pricing Procedure and Tax Procedure
    But in SD side , Pricing ,discounts and also taxes related conditions are maintained in VK11 , SD uses all custom conditions for Tax
    So my questions are as follows
    1- In standard  SD - do SAP have Pricing Procedure and Tax Procedure or both can be used within one procedure ?
    2- So in MM can we use tax conditions ( Custom tax conditions) in MM calculation schema and determine the taxes ?
    3- In MM if we use calculation scheme and tax procedure , then how tax base is determined for tax calculation ?
    Thanks and regards
    Bhushan

    Hi,
    In mm we use Pricing Procedure and Tax procedure both.
    2- So in MM can we use tax conditions ( Custom tax conditions) in MM calculation schema and determine the taxes ?
    Normally you use MM Pricing Procedure for Base price, discount, freight, packaging etc.  However for import scenario custom tax conditions like Basic Custom Duty, CVD, Cess, Sec cess is added in MM pricing procedure.
    The Tax procedure could be used for excise duties , CST, VAT, service tax.
    3- In MM if we use calculation scheme and tax procedure , then how tax base is determined for tax calculation ?
    If you check your tax procedure say taxinn you have condition type BASB and  routine for base value as 362 through which it calculates base value
    Where as in Sd you could use it in one.
    Thanks and regards

  • Diff between Calculated key figure and new formula 6extra functions why

    Hi Friends
                  In BEx query designer we have Restricted key figure & Calculated key figure. In the case of Ristricted Key figure And new selection the difference is Global and local.
    But if we come to Calculated Key figure and New Formula the difference is same global and local. But in New formula we have 6 extra function. My question is does is there any certain reason for this or SAP AG not be able to develop those functions
    Thganks & Regards
    Bramhanand

    Hi Surendra thank you for your reply.
    But i am not asking difference between calculated key figure and New formula.
    What i am asking is in the case of Restricted Key figure And new selection the difference is Global and local.
    But in Calculated Key figure and New Formula the difference is same global and local and in New formula we have 6 extra function. My question is does is there any certain reason for this.Why not SAP AG is not included the new formula functions in Calculated key figure.
    Thanks & Regards
    Bramhanand

  • Calculation procedure TAXINJ and tax key E1 not in table T007A

    Hi guys,
    While creatig a sales order I am getting the following error:
    " Calculation procedure TAXINJ and tax key E1 not in table T007A"
    Kindly suggest corrective measures.
    Bst regards,
    Ashok

    Dear ashok
    please check for the Tax code assignment which is determined in UTXJ condition.
    for the sales order.
    and check that tax code is defined as output TAX in FTXP.
    for country IN and Tax procedure TAXINJ.
    Thanks & regards

  • Explain How delivery date is calculated using backward and forward schedul

    How can anyone please explain how delivery date is calculated using forward and backward scheduling
    I want to have it broken down into the following steps
    for eg for delivery date calculation following dates are used
    Material Availabilty Date
    Material Staging Date
    Pick/pack time
    Transportation PLanning date
    Loading date
    Goods issue date
    Transit Date
    Delivery Date
    Can some one please give me an example and explain wht these dates are
    for eg customer needs delivery date on  11/20/2008
    how would the system cacluate whether it can meet the delivery date using backward scheduling
    and if it doesnt meet how does the system do the forward scheduling
    also i am not clear with the following dates
    material avaialibilty date
    material staging date
    transportation date
    can some one please explain me all this in detail
    Thanks

    Hi,
    Basically this is the CRSD(Customer requested ship date logic)logic in which system calculates the ship date depends upon the material availability. If material is available system calculates ship date on the basis of master data maintained in customisation.Master data is maintained in the  following link.
    If material is not available then system takes into consideration vendor delivery date & then calculate customer ship date.
    Please go through the link in SPRO
    LE-Shipping -Basic shipping functions-Scheduling -Delivery scheduling & Transportation scheduling-Maintain duration.
    In customisation following data is maintained
    Material Availabilty Date
    Material Staging Date
    Pick/pack time
    Transportation PLanning date
    Loading date
    Goods issue date
    Transit Date
    Delivery Date
    Hope you got the idea of CRSD calculation
    Regards,
    Prashant.

  • CRVS2010 Beta - Help Wanted for VS2010 and CR!

    I have been having a hard time getting CR to appear in the VS2010 Ultimate toolbox. I have set the target to Framework 4.0 and installed the CR4VS2010 program but the CR viewer is not showing.
    The problem is worsened by the fact that I am new to CR anyway.
    I really have been banging my head against a brick wall.
    Is there anyway to check the actual installation of CR? The Control Panel says 2008 was installed. Are there any tips about VS2010 and CR working?
    Also are there any books about VS2010 and CR? I saw a lot of CR books but there were not about VS2010.
    Thanks.
    Edited by: Ludek Uher on Jun 17, 2010 8:34 AM

    Solution: re-installed cr4VS2010 and then checked Control Panel to ensure Crystal Reports 2010 was installed. The installation is very long and I think before it had not fully installed as especially the progress bar shows 100% but the installing continues.

  • Calculating  YTD AVG and QTD AVG

    Hi All,
    I am trying to crate custom measure formula for calculating  YTD AVG and QTD AVG in BPC 7.0 NW any help

    For this formula I am using Sum divided by..
    MEMBER [MEASURES].[YTD] AS 'IIF([%P_ACCT%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="INC",SUM(PERIODSTODATE([%TIME%].[LEVEL00], [%TIME%].CURRENTMEMBER),-[MEASURES].[/CPMB/SDATA]),IIF([%P_ACCT%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="EXP",SUM(PERIODSTODATE([%TIME%].[LEVEL00], [%TIME%].CURRENTMEMBER),[MEASURES].[/CPMB/SDATA]),IIF([%P_ACCT%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="AST",([MEASURES].[/CPMB/SDATA], CLOSINGPERIOD([%TIME%].[LEVEL02])),IIF([%P_ACCT%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="LEQ",-([MEASURES].[/CPMB/SDATA], CLOSINGPERIOD([%TIME%].[LEVEL02])),-[MEASURES].[/CPMB/SDATA]))))';SOLVE_ORDER=3
    can please help me..

Maybe you are looking for

  • Media Manager Flex View Library upload crash

    The Flex View library upload option crashes whenever I try to upload anything.  I have Mac OS X Lion and am trying to sync my iPhoto library  Which is 20 Gb ie well below the 32Gb limit.  As soon as the upload starts the program quits unexpectedly.  

  • Make your LabVIEW experience more convenient

    Hi, This is where I list all of my wishlist (ideas) together. Allow to link two arrays so that they can scroll synchronously. String control/indicator/constant with line number display. Allow selecting multiple columns to be resized. Bundle/Unbundle

  • Payroll hours and days in Leave type

    Dear expert, Could you show me how to configure/maintain to able display Payroll hours and days in a leave type? Thanks, Mel

  • Different timeout between bean and method

    I have to set on the same bean a different timeout between the bean und one method. I set in the weblogic-ejb-jar.xml <trans-timeout-seconds> to 39 sec But I will set the timeout for a method in this bean to 120 sec. How con I set this timeout?

  • Why do I have lines on my landing page where i sliced it in Photoshop

    I am making a very basic landing page, designed in photoshop, As I need two buttons, I have sliced my page before importing it to dreamweaver.  Whilst initially it shows in the webbrowser correctly, when I zoom in and out it starts to show the lines