I am testing UF6 right now, and try to make the first formulas. For this i try to translate the trigonometric functions from here ... to UF.
ht__tp://github.com/mathnet/mathnet-numerics
(UF should have a complete 24 set of all trigonometric functions, for float and complex.)

Now i stack, because i not get it done to return a complex value.
Can somebody tell me how to return a complex from a func in a class?
According to help (1,0) this should return a complex.
Tanks much!

class Trig {
public:
    func Trig()
    endfunc

        static complex func Test1 (complex value)
            return (1, 0.0)  ;ERROR Operator expected
        endfunc

        static complex func Test2 (complex value)
            return complex(1, 0.0)   ;ERROR Variable expected
        endfunc

        static complex func Test3 (complex value)
            return (Real(value), 0.0)  ;ERROR Operator expected
        endfunc

        static complex func Test4 (complex value)
            return complex(Real(value), 0.0)   ;ERROR Variable expected
        endfunc
}
I am testing UF6 right now, and try to make the first formulas. For this i try to translate the trigonometric functions from here ... to UF. ht__tp://github.com/mathnet/mathnet-numerics (UF should have a complete 24 set of all trigonometric functions, for float and complex.) Now i stack, because i not get it done to return a complex value. Can somebody tell me how to return a complex from a func in a class? According to help (1,0) this should return a complex. Tanks much! ```` class Trig { public: func Trig() endfunc static complex func Test1 (complex value) return (1, 0.0) ;ERROR Operator expected endfunc static complex func Test2 (complex value) return complex(1, 0.0) ;ERROR Variable expected endfunc static complex func Test3 (complex value) return (Real(value), 0.0) ;ERROR Operator expected endfunc static complex func Test4 (complex value) return complex(Real(value), 0.0) ;ERROR Variable expected endfunc } ````
 
0
reply

This works:

        static complex func Test1 (complex value)    
            complex v = (1,0)
            return v
        endfunc

I do have all 24 trig and hyper-trig functions in jlb.ulb as members of the FT class.

This works: ```` static complex func Test1 (complex value) complex v = (1,0) return v endfunc ```` I do have all 24 trig and hyper-trig functions in jlb.ulb as members of the FT class.
 
0
reply

OK, tacks much!
Look's like a bug in the script engine.

OK, tacks much! Look's like a bug in the script engine.
 
0
reply

Thanks for the report, I'll make sure to fix that. After the fix, you should be able to use

  return (1, 0)

but

  return complex(1, 0)

will never work, you can't use types as functions in this manner. See this topic for more information:
https://www.ultrafractal.com/help/writing/language/typecompatibility.html

Thanks for the report, I'll make sure to fix that. After the fix, you should be able to use ```` return (1, 0) ```` but ```` return complex(1, 0) ```` will never work, you can't use types as functions in this manner. See this topic for more information: https://www.ultrafractal.com/help/writing/language/typecompatibility.html

Ultra Fractal author

edited Jan 26 at 2:32 pm
 
0
reply

OK tanks much!

return complex (1, 0)
was only a try from a beginner, (casting)...

OK tanks much! return complex (1, 0) was only a try from a beginner, (casting)...
 
0
reply

(i still work with old software, and test period of UF is expired. but i think the error is still there in v6.06.)

    static complex func Test1 (float re, float im)    
        complex v = (re,im) ;ERROR
        return v
    endfunc

    static complex func Test1 (float re, float im)    
        return (re,im) ;ERROR
    endfunc
(i still work with old software, and test period of UF is expired. but i think the error is still there in v6.06.) static complex func Test1 (float re, float im) complex v = (re,im) ;ERROR return v endfunc static complex func Test1 (float re, float im) return (re,im) ;ERROR endfunc
 
0
reply

The usual way is
complex v = re + flip(im)
It works.

The usual way is complex v = re + flip(im) It works.
 
0
reply

Tanks, yes it works.
(I tried flip(im,re) :-)

But it is still a bug, I think.

Tanks, yes it works. (I tried flip(im,re) :-) But it is still a bug, I think.
 
0
reply
114
views
7
replies
3
followers
live preview
Enter at least 10 characters.
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft