Changeset a1ecfc3 in sasview for sansmodels/src


Ignore:
Timestamp:
Oct 7, 2010 3:48:06 PM (14 years ago)
Author:
Jae Cho <jhjcho@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
94a3f8f
Parents:
fbae881
Message:

found and fixed number precision error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/sans/models/c_extensions/parallelepiped.c

    rf10063e ra1ecfc3  
    3939 
    4040    //handle arg=0 separately, as sin(t)/t -> 1 as t->0 
    41     argA = a*ala/2; 
    42     argB = b*alb/2; 
    43     argC = c*alc/2; 
     41    argA = a*ala/2.0; 
     42    argB = b*alb/2.0; 
     43    argC = c*alc/2.0; 
    4444    if(argA==0.0) { 
    4545                tmp1 = 1.0; 
     
    117117 
    118118    // q vector 
    119     q_z = 0; 
     119    q_z = 0.0; 
    120120 
    121121    // Compute the angle btw vector q and the 
     
    133133 
    134134    // parallelepiped b axis orientation 
    135     bparallel_x = sqrt(1-sin(pars->parallel_theta)*cos(pars->parallel_phi))*cos(pars->parallel_psi);//cos(pars->parallel_theta) * cos(pars->parallel_phi)* cos(pars->parallel_psi); 
    136     bparallel_y = sqrt(1-sin(pars->parallel_theta)*cos(pars->parallel_phi))*sin(pars->parallel_psi);//cos(pars->parallel_theta) * sin(pars->parallel_phi)* sin(pars->parallel_psi); 
     135    bparallel_x = sqrt(1.0-sin(pars->parallel_theta)*cos(pars->parallel_phi))*cos(pars->parallel_psi);//cos(pars->parallel_theta) * cos(pars->parallel_phi)* cos(pars->parallel_psi); 
     136    bparallel_y = sqrt(1.0-sin(pars->parallel_theta)*cos(pars->parallel_phi))*sin(pars->parallel_psi);//cos(pars->parallel_theta) * sin(pars->parallel_phi)* sin(pars->parallel_psi); 
    137137    // axis of the parallelepiped 
    138138    cos_val_b = sin(acos(cos_val_a)) ; 
Note: See TracChangeset for help on using the changeset viewer.