ziko 0.54.1 → 0.54.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ziko.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  /*
3
3
  Project: ziko.js
4
4
  Author: Zakaria Elalaoui
5
- Date : Wed Dec 10 2025 13:44:02 GMT+0100 (UTC+01:00)
5
+ Date : Fri Dec 12 2025 14:53:26 GMT+0100 (UTC+01:00)
6
6
  Git-Repo : https://github.com/zakarialaoui10/ziko.js
7
7
  Git-Wiki : https://github.com/zakarialaoui10/ziko.js/wiki
8
8
  Released under MIT License
@@ -125,6 +125,13 @@ class Complex{
125
125
  static Zero() {
126
126
  return new Complex(0, 0);
127
127
  }
128
+ static Twidlle(N, K){
129
+ const phi = -2 * Math.PI * K / N;
130
+ return new Complex(
131
+ Math.cos(phi),
132
+ Math.sin(phi)
133
+ );
134
+ }
128
135
  get conj() {
129
136
  return new Complex(this.a, -this.b);
130
137
  }
@@ -159,7 +166,7 @@ class Complex{
159
166
  }
160
167
  this.a = z * Math.cos(phi);
161
168
  this.b = z * Math.sin(phi);
162
- return this;
169
+ return this.toFixed(8);
163
170
  }
164
171
  div(...c){
165
172
  let {z, phi} = this;
@@ -168,10 +175,9 @@ class Complex{
168
175
  z /= c[i].z;
169
176
  phi -= c[i].phi;
170
177
  }
171
- this.a = z*Math.cos(phi);
172
- this.b = z*Math.sin(phi);
173
- return this;
174
- }
178
+ this.a = z * Math.cos(phi);
179
+ this.b = z * Math.sin(phi);
180
+ return this.toFixed(8); }
175
181
  modulo(...c) {
176
182
  for (let i = 0; i < c.length; i++) {
177
183
  if (typeof c[i] === "number") c[i] = new Complex(c[i], 0);
@@ -255,6 +261,8 @@ const complex=(a,b)=>{
255
261
  return new Complex(a,b)
256
262
  };
257
263
 
264
+ const PRECESION = 8;
265
+
258
266
  const abs = (...x) => mapfun(
259
267
  x =>{
260
268
  if(x.isComplex?.()) return x.z;
@@ -288,8 +296,8 @@ const sqrt$2 = (...x) => mapfun(
288
296
  x=>{
289
297
  if(x.isComplex?.())
290
298
  return new x.constructor({z: x.z**(1/2), phi: x.phi/2});
291
- if(x < 0) return complex(0, Math.sqrt(-x))
292
- return Math.sqrt(x);
299
+ if(x < 0) return complex(0, Math.sqrt(-x)).toFixed(PRECESION)
300
+ return + Math.sqrt(x).toFixed(PRECESION);
293
301
  },
294
302
  ...x
295
303
  );
@@ -297,8 +305,8 @@ const sqrt$2 = (...x) => mapfun(
297
305
  const cbrt = (...x) => mapfun(
298
306
  x=>{
299
307
  if(x.isComplex?.())
300
- return new x.constructor({z: x.z**(1/3), phi: x.phi/3})
301
- return Math.cbrt(x);
308
+ return new x.constructor({z: x.z**(1/3), phi: x.phi/3}).toFixed(PRECESION)
309
+ return + Math.cbrt(x).toFixed(PRECESION);
302
310
  },
303
311
  ...x
304
312
  );
@@ -309,8 +317,10 @@ const nthr = (...x) => {
309
317
  return mapfun(
310
318
  x => {
311
319
  if(x.isComplex?.()) return new x.constructor({z: x.z ** (1/n), phi: x.phi / n});
312
- if(x<0) return n%2===2 ? complex(0, (-x)**(1/n)) : -1 * (-x)**(1/n)
313
- return x**(1/n)
320
+ if(x<0) return n %2 ===2
321
+ ? complex(0, (-x)**(1/n)).toFixed(PRECESION)
322
+ : + (-1 * (-x)**(1/n)).toFixed(PRECESION)
323
+ return + (x**(1/n)).toFixed(PRECESION)
314
324
  },
315
325
  ...x
316
326
  )
@@ -330,7 +340,7 @@ const croot = (...x) =>{
330
340
  return new c.constructor(
331
341
  A * Math.cos(B),
332
342
  A * Math.sin(B)
333
- )
343
+ ).toFixed(PRECESION)
334
344
  },
335
345
  ...x
336
346
  )
@@ -341,8 +351,8 @@ const exp$1 = (...x) => mapfun(
341
351
  if(x.isComplex?.()) return new x.constructor(
342
352
  Math.exp(x.a) * Math.cos(x.b),
343
353
  Math.exp(x.a) * Math.sin(x.b)
344
- );
345
- return Math.exp(x)
354
+ ).toFixed(PRECESION);
355
+ return + Math.exp(x).toFixed(PRECESION)
346
356
  }
347
357
  ,...x
348
358
  );
@@ -352,8 +362,8 @@ const ln = (...x) => mapfun(
352
362
  if(x.isComplex?.()) return new x.constructor(
353
363
  Math.log(x.z),
354
364
  x.phi
355
- );
356
- return Math.log(x)
365
+ ).toFixed(PRECESION);
366
+ return + Math.log(x).toFixed(PRECESION)
357
367
  }
358
368
  ,...x
359
369
  );
@@ -428,8 +438,8 @@ const cos$3 = (...x) => mapfun(
428
438
  if(x.isComplex?.()) return new x.constructor(
429
439
  Math.cos(x.a) * Math.cosh(x.b),
430
440
  -Math.sin(x.a) * Math.sinh(x.b)
431
- );
432
- return Math.cos(x)
441
+ ).toFixed(PRECESION);
442
+ return + Math.cos(x).toFixed(PRECESION)
433
443
  }
434
444
  ,...x
435
445
  );
@@ -439,8 +449,8 @@ const sin$3 = (...x) => mapfun(
439
449
  if(x?.isComplex) return new x.constructor(
440
450
  Math.sin(x.a) * Math.cosh(x.b),
441
451
  Math.cos(x.a) * Math.sinh(x.b)
442
- );
443
- return Math.sin(x)
452
+ ).toFixed(PRECESION);
453
+ return + Math.sin(x).toFixed(PRECESION)
444
454
  }
445
455
  , ...x
446
456
  );
@@ -452,9 +462,9 @@ const tan = (...x) => mapfun(
452
462
  return new x.constructor(
453
463
  Math.sin(2*x.a) / D,
454
464
  Math.sinh(2*x.b) / D
455
- );
465
+ ).toFixed(PRECESION);
456
466
  }
457
- return Math.tan(x)
467
+ return + Math.tan(x).toFixed(PRECESION)
458
468
  },
459
469
  ...x
460
470
  );
@@ -462,7 +472,7 @@ const tan = (...x) => mapfun(
462
472
  const sec = (...x) => mapfun(
463
473
  x => {
464
474
  if(x.isComplex?.()) ;
465
- return 1 / Math.cos(x)
475
+ return + (1 / Math.cos(x)).toFixed(PRECESION)
466
476
  }
467
477
  ,...x
468
478
  );
@@ -478,9 +488,9 @@ const acos$1 = (...x) => mapfun(
478
488
  return new x.constructor(
479
489
  Math.acos((Rp - Rm) / 2),
480
490
  -Math.acosh((Rp + Rm) / 2),
481
- )
491
+ ).toFixed(PRECESION)
482
492
  }
483
- return Math.acos(x)
493
+ return + Math.acos(x).toFixed(PRECESION)
484
494
  },
485
495
  ...x
486
496
  );
@@ -494,9 +504,9 @@ const asin = (...x) => mapfun(
494
504
  return new x.constructor(
495
505
  Math.asin((Rp - Rm) / 2),
496
506
  Math.acosh((Rp + Rm) / 2)
497
- );
507
+ ).toFixed(PRECESION);
498
508
  }
499
- return Math.asin(x);
509
+ return + Math.asin(x).toFixed(PRECESION);
500
510
  },
501
511
  ...x
502
512
  );
@@ -508,9 +518,9 @@ const atan = (...x) => mapfun(
508
518
  return new x.constructor(
509
519
  Math.atan((a*2/(1-a**2-b**2)))/2,
510
520
  Math.log((a**2 + (1+b)**2)/(a**2 + (1-b)**2))/4
511
- )
521
+ ).toFixed(PRECESION)
512
522
  }
513
- return Math.atan(x);
523
+ return + Math.atan(x).toFixed(PRECESION);
514
524
  },
515
525
  ...x
516
526
  );
@@ -522,9 +532,9 @@ const acot = (...x) => mapfun(
522
532
  return new x.constructor(
523
533
  Math.atan(2*a/(a**2+(b-1)*(b+1)))/2,
524
534
  Math.log((a**2 + (b-1)**2)/(a**2 + (b+1)**2))/4
525
- )
535
+ ).toFixed(PRECESION)
526
536
  }
527
- return Math.PI/2 - Math.atan(x);
537
+ return + (Math.PI/2 - Math.atan(x)).toFixed(PRECESION);
528
538
  },
529
539
  ...x
530
540
  );
@@ -535,8 +545,8 @@ const cosh$2 = (...x) => mapfun(
535
545
  if(x?.isComplex) return new x.constructor(
536
546
  Math.cosh(x.a) * Math.cos(x.b),
537
547
  Math.sinh(x.a) * Math.sin(x.b)
538
- );
539
- return Math.cosh(x)
548
+ ).toFixed(PRECESION);
549
+ return + Math.cosh(x).toFixed(PRECESION)
540
550
  },
541
551
  ...x
542
552
  );
@@ -545,8 +555,8 @@ const sinh$1 = (...x) => mapfun(
545
555
  if(x?.isComplex) return new x.constructor(
546
556
  Math.sinh(x.a) * Math.cos(x.b),
547
557
  Math.cosh(x.a) * Math.sin(x.b)
548
- );
549
- return Math.sinh(x)
558
+ ).toFixed(PRECESION);
559
+ return + Math.sinh(x).toFixed(PRECESION)
550
560
  },
551
561
  ...x
552
562
  );
@@ -557,9 +567,9 @@ const tanh = (...x) => mapfun(
557
567
  return new x.constructor(
558
568
  Math.sinh(2*a) / D,
559
569
  Math.sin(2*b) / D
560
- )
570
+ ).toFixed(PRECESION)
561
571
  }
562
- return Math.tanh(x)
572
+ return + Math.tanh(x).toFixed(PRECESION)
563
573
  },
564
574
  ...x
565
575
  );
@@ -572,9 +582,9 @@ const coth = (...x) => mapfun(
572
582
  return new x.constructor(
573
583
  Math.cosh(a) * Math.sinh(a) / D,
574
584
  - Math.sin(b) * Math.cos(b) / D
575
- )
585
+ ).toFixed(PRECESION)
576
586
  }
577
- return 1/Math.tanh(x)
587
+ return + (1 / Math.tanh(x)).toFixed(PRECESION)
578
588
  },
579
589
  ...x
580
590
  );
@@ -584,7 +594,7 @@ const acosh = (...x) => mapfun(
584
594
  if(x?.isComplex){
585
595
  return ln(x.clone().add(sqrt$2(x.clone().mul(x.clone()).sub(1))))
586
596
  }
587
- return Math.acosh(x)
597
+ return + Math.acosh(x).toFixed(PRECESION)
588
598
  },
589
599
  ...x
590
600
  );
@@ -594,7 +604,7 @@ const asinh = (...x) => mapfun(
594
604
  if(x?.isComplex){
595
605
  return ln(x.clone().add(sqrt$2(x.clone().mul(x.clone()).add(1))))
596
606
  }
597
- return Math.asinh(x)
607
+ return + Math.asinh(x).toFixed(PRECESION)
598
608
  },
599
609
  ...x
600
610
  );
@@ -602,7 +612,7 @@ const asinh = (...x) => mapfun(
602
612
  const atanh = (...x) => mapfun(
603
613
  x =>{
604
614
  if(x?.isComplex);
605
- return Math.atanh(x)
615
+ return + Math.atanh(x).toFixed(PRECESION)
606
616
  },
607
617
  ...x
608
618
  );
@@ -610,7 +620,7 @@ const atanh = (...x) => mapfun(
610
620
  const sig = (...x) => mapfun(
611
621
  x =>{
612
622
  if(x?.isComplex);
613
- return 1/(1+Math.exp(-x))
623
+ return 1/(1 + Math.exp(-x)).toFixed(PRECESION)
614
624
  },
615
625
  ...x
616
626
  );
@@ -623,7 +633,7 @@ const _add = (x, y) =>{
623
633
  }
624
634
  }
625
635
  if(x.isComplex?.()){
626
- if(typeof y === 'number' || y.isComplex?.()) return new x.clone().add(y);
636
+ if(typeof y === 'number' || y.isComplex?.()) return x.clone().add(y);
627
637
  }
628
638
  };
629
639
 
@@ -633,7 +643,7 @@ const _sub = (x, y) =>{
633
643
  if(y.isComplex?.()) return new y.constructor(x - y.a, y.b);
634
644
  }
635
645
  if(x.isComplex?.()){
636
- if(typeof y === 'number' || y.isComplex?.()) return new x.clone().sub(y);
646
+ if(typeof y === 'number' || y.isComplex?.()) return x.clone().sub(y);
637
647
  }
638
648
  };
639
649
 
@@ -653,7 +663,7 @@ const _div = (x, y) =>{
653
663
  if(y.isComplex?.()) return new y.constructor(x, 0).div(y)
654
664
  }
655
665
  if(x.isComplex?.()){
656
- if(typeof y === 'number' || y.isComplex?.()) return new x.clone().mul(y);
666
+ if(typeof y === 'number' || y.isComplex?.()) return x.clone().mul(y);
657
667
  }
658
668
  };
659
669
 
@@ -663,7 +673,7 @@ const _modulo = (x, y) =>{
663
673
  if(y.isComplex?.()) return new y.constructor(x, 0).modulo(y)
664
674
  }
665
675
  if(x.isComplex?.()){
666
- if(typeof y === 'number' || y.isComplex?.()) return new x.clone().modulo(y);
676
+ if(typeof y === 'number' || y.isComplex?.()) return x.clone().modulo(y);
667
677
  }
668
678
  };
669
679
 
@@ -3380,6 +3390,14 @@ class Matrix{
3380
3390
  clone() {
3381
3391
  return new Matrix(this.rows, this.cols, this.arr.flat(1));
3382
3392
  }
3393
+ toComplex(){
3394
+ this.arr = mapfun(
3395
+ x => x?.isComplex?.() ? x : new Complex(x, 0),
3396
+ ...this.arr
3397
+ );
3398
+ this.#maintain();
3399
+ return this;
3400
+ }
3383
3401
  [Symbol.iterator]() {
3384
3402
  return this.arr[Symbol.iterator]();
3385
3403
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ziko",
3
- "version": "0.54.1",
3
+ "version": "0.54.3",
4
4
  "description": "A versatile JavaScript library offering a rich set of Hyperscript Based UI components, advanced mathematical utilities, interactivity ,animations, client side routing and more ...",
5
5
  "keywords": [
6
6
  "front-end",
@@ -1,4 +1,4 @@
1
- import { Matrix } from "../../math/matrix/matrix.js"
1
+ import { Matrix } from "../../math/matrix/index.js"
2
2
  const csv2arr = (csv, delimiter = ",")=>csv.trim().trimEnd().split("\n").map(n=>n.split(delimiter));
3
3
  const csv2matrix = (csv, delimiter = ",")=>new Matrix(csv2arr(csv,delimiter));
4
4
  const csv2object = (csv, delimiter = ",") => {
@@ -77,6 +77,13 @@ class Complex{
77
77
  static Zero() {
78
78
  return new Complex(0, 0);
79
79
  }
80
+ static Twidlle(N, K){
81
+ const phi = -2 * Math.PI * K / N;
82
+ return new Complex(
83
+ Math.cos(phi),
84
+ Math.sin(phi)
85
+ );
86
+ }
80
87
  get conj() {
81
88
  return new Complex(this.a, -this.b);
82
89
  }
@@ -111,7 +118,7 @@ class Complex{
111
118
  }
112
119
  this.a = z * Math.cos(phi)
113
120
  this.b = z * Math.sin(phi)
114
- return this;
121
+ return this.toFixed(8);
115
122
  }
116
123
  div(...c){
117
124
  let {z, phi} = this;
@@ -120,9 +127,9 @@ class Complex{
120
127
  z /= c[i].z;
121
128
  phi -= c[i].phi;
122
129
  }
123
- this.a = z*Math.cos(phi)
124
- this.b = z*Math.sin(phi)
125
- return this;
130
+ this.a = z * Math.cos(phi)
131
+ this.b = z * Math.sin(phi)
132
+ return this.toFixed(8);;
126
133
  }
127
134
  modulo(...c) {
128
135
  for (let i = 0; i < c.length; i++) {
@@ -1,5 +1,5 @@
1
1
  import { Complex } from "../../complex/index.js";
2
- import { Matrix } from "../../matrix/matrix.js";
2
+ import { Matrix } from "../../matrix/index.js";
3
3
  const Base={
4
4
  _mode:Number,
5
5
  _map:function(func,number,toBase){
@@ -1,5 +1,5 @@
1
1
  import { Complex } from "../../complex/index.js";
2
- import { Matrix } from "../../matrix/matrix.js";
2
+ import { Matrix } from "../../matrix/index.js";
3
3
  const Logic={
4
4
  _mode:Number,
5
5
  _map:function(func,a,b){
@@ -6,7 +6,7 @@ const _add = (x, y) =>{
6
6
  }
7
7
  }
8
8
  if(x.isComplex?.()){
9
- if(typeof y === 'number' || y.isComplex?.()) return new x.clone().add(y);
9
+ if(typeof y === 'number' || y.isComplex?.()) return x.clone().add(y);
10
10
  }
11
11
  }
12
12
 
@@ -16,7 +16,7 @@ const _sub = (x, y) =>{
16
16
  if(y.isComplex?.()) return new y.constructor(x - y.a, y.b);
17
17
  }
18
18
  if(x.isComplex?.()){
19
- if(typeof y === 'number' || y.isComplex?.()) return new x.clone().sub(y);
19
+ if(typeof y === 'number' || y.isComplex?.()) return x.clone().sub(y);
20
20
  }
21
21
  }
22
22
 
@@ -36,7 +36,7 @@ const _div = (x, y) =>{
36
36
  if(y.isComplex?.()) return new y.constructor(x, 0).div(y)
37
37
  }
38
38
  if(x.isComplex?.()){
39
- if(typeof y === 'number' || y.isComplex?.()) return new x.clone().mul(y);
39
+ if(typeof y === 'number' || y.isComplex?.()) return x.clone().mul(y);
40
40
  }
41
41
  }
42
42
 
@@ -46,7 +46,7 @@ const _modulo = (x, y) =>{
46
46
  if(y.isComplex?.()) return new y.constructor(x, 0).modulo(y)
47
47
  }
48
48
  if(x.isComplex?.()){
49
- if(typeof y === 'number' || y.isComplex?.()) return new x.clone().modulo(y);
49
+ if(typeof y === 'number' || y.isComplex?.()) return x.clone().modulo(y);
50
50
  }
51
51
  }
52
52
 
@@ -1,6 +1,8 @@
1
1
  import { mapfun } from '../mapfun/index.js';
2
2
  import { complex } from '../../complex/index.js'
3
3
 
4
+ const PRECESION = 8
5
+
4
6
  export const abs = (...x) => mapfun(
5
7
  x =>{
6
8
  if(x.isComplex?.()) return x.z;
@@ -34,8 +36,8 @@ export const sqrt = (...x) => mapfun(
34
36
  x=>{
35
37
  if(x.isComplex?.())
36
38
  return new x.constructor({z: x.z**(1/2), phi: x.phi/2});
37
- if(x < 0) return complex(0, Math.sqrt(-x))
38
- return Math.sqrt(x);
39
+ if(x < 0) return complex(0, Math.sqrt(-x)).toFixed(PRECESION)
40
+ return + Math.sqrt(x).toFixed(PRECESION);
39
41
  },
40
42
  ...x
41
43
  );
@@ -43,8 +45,8 @@ export const sqrt = (...x) => mapfun(
43
45
  export const cbrt = (...x) => mapfun(
44
46
  x=>{
45
47
  if(x.isComplex?.())
46
- return new x.constructor({z: x.z**(1/3), phi: x.phi/3})
47
- return Math.cbrt(x);
48
+ return new x.constructor({z: x.z**(1/3), phi: x.phi/3}).toFixed(PRECESION)
49
+ return + Math.cbrt(x).toFixed(PRECESION);
48
50
  },
49
51
  ...x
50
52
  );
@@ -55,8 +57,10 @@ export const nthr = (...x) => {
55
57
  return mapfun(
56
58
  x => {
57
59
  if(x.isComplex?.()) return new x.constructor({z: x.z ** (1/n), phi: x.phi / n});
58
- if(x<0) return n%2===2 ? complex(0, (-x)**(1/n)) : -1 * (-x)**(1/n)
59
- return x**(1/n)
60
+ if(x<0) return n %2 ===2
61
+ ? complex(0, (-x)**(1/n)).toFixed(PRECESION)
62
+ : + (-1 * (-x)**(1/n)).toFixed(PRECESION)
63
+ return + (x**(1/n)).toFixed(PRECESION)
60
64
  },
61
65
  ...x
62
66
  )
@@ -76,7 +80,7 @@ export const croot = (...x) =>{
76
80
  return new c.constructor(
77
81
  A * Math.cos(B),
78
82
  A * Math.sin(B)
79
- )
83
+ ).toFixed(PRECESION)
80
84
  },
81
85
  ...x
82
86
  )
@@ -87,8 +91,8 @@ export const exp = (...x) => mapfun(
87
91
  if(x.isComplex?.()) return new x.constructor(
88
92
  Math.exp(x.a) * Math.cos(x.b),
89
93
  Math.exp(x.a) * Math.sin(x.b)
90
- );
91
- return Math.exp(x)
94
+ ).toFixed(PRECESION);
95
+ return + Math.exp(x).toFixed(PRECESION)
92
96
  }
93
97
  ,...x
94
98
  );
@@ -98,8 +102,8 @@ export const ln = (...x) => mapfun(
98
102
  if(x.isComplex?.()) return new x.constructor(
99
103
  Math.log(x.z),
100
104
  x.phi
101
- );
102
- return Math.log(x)
105
+ ).toFixed(PRECESION);
106
+ return + Math.log(x).toFixed(PRECESION)
103
107
  }
104
108
  ,...x
105
109
  );
@@ -174,8 +178,8 @@ export const cos = (...x) => mapfun(
174
178
  if(x.isComplex?.()) return new x.constructor(
175
179
  Math.cos(x.a) * Math.cosh(x.b),
176
180
  -Math.sin(x.a) * Math.sinh(x.b)
177
- );
178
- return Math.cos(x)
181
+ ).toFixed(PRECESION);
182
+ return + Math.cos(x).toFixed(PRECESION)
179
183
  }
180
184
  ,...x
181
185
  );
@@ -185,8 +189,8 @@ export const sin = (...x) => mapfun(
185
189
  if(x?.isComplex) return new x.constructor(
186
190
  Math.sin(x.a) * Math.cosh(x.b),
187
191
  Math.cos(x.a) * Math.sinh(x.b)
188
- );
189
- return Math.sin(x)
192
+ ).toFixed(PRECESION);
193
+ return + Math.sin(x).toFixed(PRECESION)
190
194
  }
191
195
  , ...x
192
196
  );
@@ -198,9 +202,9 @@ export const tan = (...x) => mapfun(
198
202
  return new x.constructor(
199
203
  Math.sin(2*x.a) / D,
200
204
  Math.sinh(2*x.b) / D
201
- );
205
+ ).toFixed(PRECESION);
202
206
  }
203
- return Math.tan(x)
207
+ return + Math.tan(x).toFixed(PRECESION)
204
208
  },
205
209
  ...x
206
210
  );
@@ -210,7 +214,7 @@ export const sec = (...x) => mapfun(
210
214
  if(x.isComplex?.()) {
211
215
 
212
216
  }
213
- return 1 / Math.cos(x)
217
+ return + (1 / Math.cos(x)).toFixed(PRECESION)
214
218
  }
215
219
  ,...x
216
220
  );
@@ -226,9 +230,9 @@ export const acos = (...x) => mapfun(
226
230
  return new x.constructor(
227
231
  Math.acos((Rp - Rm) / 2),
228
232
  -Math.acosh((Rp + Rm) / 2),
229
- )
233
+ ).toFixed(PRECESION)
230
234
  }
231
- return Math.acos(x)
235
+ return + Math.acos(x).toFixed(PRECESION)
232
236
  },
233
237
  ...x
234
238
  );
@@ -242,9 +246,9 @@ export const asin = (...x) => mapfun(
242
246
  return new x.constructor(
243
247
  Math.asin((Rp - Rm) / 2),
244
248
  Math.acosh((Rp + Rm) / 2)
245
- );
249
+ ).toFixed(PRECESION);
246
250
  }
247
- return Math.asin(x);
251
+ return + Math.asin(x).toFixed(PRECESION);
248
252
  },
249
253
  ...x
250
254
  );
@@ -256,9 +260,9 @@ export const atan = (...x) => mapfun(
256
260
  return new x.constructor(
257
261
  Math.atan((a*2/(1-a**2-b**2)))/2,
258
262
  Math.log((a**2 + (1+b)**2)/(a**2 + (1-b)**2))/4
259
- )
263
+ ).toFixed(PRECESION)
260
264
  }
261
- return Math.atan(x);
265
+ return + Math.atan(x).toFixed(PRECESION);
262
266
  },
263
267
  ...x
264
268
  );
@@ -270,9 +274,9 @@ export const acot = (...x) => mapfun(
270
274
  return new x.constructor(
271
275
  Math.atan(2*a/(a**2+(b-1)*(b+1)))/2,
272
276
  Math.log((a**2 + (b-1)**2)/(a**2 + (b+1)**2))/4
273
- )
277
+ ).toFixed(PRECESION)
274
278
  }
275
- return Math.PI/2 - Math.atan(x);
279
+ return + (Math.PI/2 - Math.atan(x)).toFixed(PRECESION);
276
280
  },
277
281
  ...x
278
282
  );
@@ -283,8 +287,8 @@ export const cosh = (...x) => mapfun(
283
287
  if(x?.isComplex) return new x.constructor(
284
288
  Math.cosh(x.a) * Math.cos(x.b),
285
289
  Math.sinh(x.a) * Math.sin(x.b)
286
- );
287
- return Math.cosh(x)
290
+ ).toFixed(PRECESION);
291
+ return + Math.cosh(x).toFixed(PRECESION)
288
292
  },
289
293
  ...x
290
294
  )
@@ -293,8 +297,8 @@ export const sinh = (...x) => mapfun(
293
297
  if(x?.isComplex) return new x.constructor(
294
298
  Math.sinh(x.a) * Math.cos(x.b),
295
299
  Math.cosh(x.a) * Math.sin(x.b)
296
- );
297
- return Math.sinh(x)
300
+ ).toFixed(PRECESION);
301
+ return + Math.sinh(x).toFixed(PRECESION)
298
302
  },
299
303
  ...x
300
304
  )
@@ -305,9 +309,9 @@ export const tanh = (...x) => mapfun(
305
309
  return new x.constructor(
306
310
  Math.sinh(2*a) / D,
307
311
  Math.sin(2*b) / D
308
- )
312
+ ).toFixed(PRECESION)
309
313
  }
310
- return Math.tanh(x)
314
+ return + Math.tanh(x).toFixed(PRECESION)
311
315
  },
312
316
  ...x
313
317
  )
@@ -320,9 +324,9 @@ export const coth = (...x) => mapfun(
320
324
  return new x.constructor(
321
325
  Math.cosh(a) * Math.sinh(a) / D,
322
326
  - Math.sin(b) * Math.cos(b) / D
323
- )
327
+ ).toFixed(PRECESION)
324
328
  }
325
- return 1/Math.tanh(x)
329
+ return + (1 / Math.tanh(x)).toFixed(PRECESION)
326
330
  },
327
331
  ...x
328
332
  )
@@ -332,7 +336,7 @@ export const acosh = (...x) => mapfun(
332
336
  if(x?.isComplex){
333
337
  return ln(x.clone().add(sqrt(x.clone().mul(x.clone()).sub(1))))
334
338
  }
335
- return Math.acosh(x)
339
+ return + Math.acosh(x).toFixed(PRECESION)
336
340
  },
337
341
  ...x
338
342
  )
@@ -342,7 +346,7 @@ export const asinh = (...x) => mapfun(
342
346
  if(x?.isComplex){
343
347
  return ln(x.clone().add(sqrt(x.clone().mul(x.clone()).add(1))))
344
348
  }
345
- return Math.asinh(x)
349
+ return + Math.asinh(x).toFixed(PRECESION)
346
350
  },
347
351
  ...x
348
352
  )
@@ -352,7 +356,7 @@ export const atanh = (...x) => mapfun(
352
356
  if(x?.isComplex){
353
357
 
354
358
  }
355
- return Math.atanh(x)
359
+ return + Math.atanh(x).toFixed(PRECESION)
356
360
  },
357
361
  ...x
358
362
  )
@@ -362,7 +366,7 @@ export const sig = (...x) => mapfun(
362
366
  if(x?.isComplex){
363
367
 
364
368
  }
365
- return 1/(1+Math.exp(-x))
369
+ return + 1/(1 + Math.exp(-x)).toFixed(PRECESION)
366
370
  },
367
371
  ...x
368
372
  )