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

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

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

OK, tacks much! Look&#039;s like a bug in the script engine.

0

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&#039;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&#039;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

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

(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

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

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

0

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

I did fix the bug in version 6.06, so you can now return a literal complex value directly:
https://www.ultrafractal.com/kb/uf606.html

I did fix the bug in version 6.06, so you can now return a literal complex value directly: https://www.ultrafractal.com/kb/uf606.html

Ultra Fractal author

0

Another bug in the script engine. If you have a class in a .ucl file at the top level, below other formulas, and there's a syntax error in the class or any formula below it, the line number shown in the warning dialog is completely off.

Another bug in the script engine. If you have a class in a .ucl file at the top level, below other formulas, and there&#039;s a syntax error in the class or any formula below it, the line number shown in the warning dialog is completely off.
edited Jul 21 at 9:40 pm

0

Will look into that!

Will look into that!

Ultra Fractal author

0
229
views
10
replies
4
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