Paste: Modifying a c-struct

Author: dukeleto
Mode: factor
Date: Sun, 9 Nov 2008 05:27:11
Plain Text |
! Copyright (C) 2008 Jonathan Leto.
! See http://factorcode.org/license.txt for BSD license.

USING: alien.c-types kernel math math.functions tools.test gsl gsl.sf.airy math.analysis ;
USING: gsl.sf.result ;
IN: gsl.sf.airy.tests

: eps
    1.0e-12 ;

: gamma-const          
    1 2 3 / gamma / ;

: result 
    "gsl_sf_result" <c-object> ;

: Ai_0
    3 -2/3 ^ gamma-const * ;

: precision 
    0 ;

[ t ] [ 0 0 precision result gsl_sf_airy_Ai_e       = ] unit-test
[ t ] [ Ai_0 result gsl_sf_result-val           eps ~ ] unit-test
[ t ] [ -2.33810741045977 1 gsl_sf_airy_zero_Ai eps ~ ] unit-test 

Annotation: The result struct

Author: dukeleto
Mode: factor
Date: Sun, 9 Nov 2008 05:27:24
Plain Text |
USING:   gsl alien.syntax ;
IN:      gsl.sf.result
LIBRARY: gsl

C-STRUCT: gsl_sf_result
    { "double" "val" } 
    { "double" "err" } ;

New Annotation

Summary:
Author:
Mode:
Body: