@@ -178,9 +178,9 @@ export const createTyped = /* #__PURE__ */ factory('typed', dependencies, functi
178178
179179 // note: conversion from number to BigNumber can fail if x has >15 digits
180180 if ( digits ( x ) > 15 ) {
181- throw new TypeError ( 'Cannot implicitly convert a number with >15 significant digits to BigNumber ' +
182- '(value : ' + x + '). ' +
183- 'Use function bignumber(x) to convert to BigNumber .')
181+ throw new TypeError ( '无法隐式将一个>15位的浮点数转换为大数 ' +
182+ '(值 : ' + x + '). ' +
183+ '使用函数 bignumber(x) 转换为大数 .')
184184 }
185185 return new BigNumber ( x )
186186 }
@@ -239,8 +239,8 @@ export const createTyped = /* #__PURE__ */ factory('typed', dependencies, functi
239239 from : 'Fraction' ,
240240 to : 'BigNumber' ,
241241 convert : function ( x ) {
242- throw new TypeError ( 'Cannot implicitly convert a Fraction to BigNumber or vice versa. ' +
243- 'Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction .')
242+ throw new TypeError ( '无法将分数隐式转换为大数,反之亦然。 ' +
243+ '使用函数 bignumber(x) 转换为大数或 fraction(x) 转换为分数 .')
244244 }
245245 } , {
246246 from : 'Fraction' ,
@@ -262,9 +262,9 @@ export const createTyped = /* #__PURE__ */ factory('typed', dependencies, functi
262262
263263 const f = new Fraction ( x )
264264 if ( f . valueOf ( ) !== x ) {
265- throw new TypeError ( 'Cannot implicitly convert a number to a Fraction when there will be a loss of precision ' +
266- '(value : ' + x + '). ' +
267- 'Use function fraction(x) to convert to Fraction .')
265+ throw new TypeError ( '当存在精度损失时,无法将一个数字隐式转换为分数 ' +
266+ '(值 : ' + x + '). ' +
267+ '使用函数 fraction(x) 转换为分数 .')
268268 }
269269 return f
270270 }
@@ -281,7 +281,7 @@ export const createTyped = /* #__PURE__ */ factory('typed', dependencies, functi
281281 convert : function ( x ) {
282282 const n = Number ( x )
283283 if ( isNaN ( n ) ) {
284- throw new Error ( 'Cannot convert "' + x + '" to a number ' )
284+ throw new Error ( '无法将 "' + x + '" 转换为浮点数 ' )
285285 }
286286 return n
287287 }
@@ -296,7 +296,7 @@ export const createTyped = /* #__PURE__ */ factory('typed', dependencies, functi
296296 try {
297297 return new BigNumber ( x )
298298 } catch ( err ) {
299- throw new Error ( 'Cannot convert "' + x + '" to BigNumber ' )
299+ throw new Error ( '无法将 "' + x + '" 转换为大数 ' )
300300 }
301301 }
302302 } , {
@@ -320,7 +320,7 @@ export const createTyped = /* #__PURE__ */ factory('typed', dependencies, functi
320320 try {
321321 return new Fraction ( x )
322322 } catch ( err ) {
323- throw new Error ( 'Cannot convert "' + x + '" to Fraction ' )
323+ throw new Error ( '无法将 "' + x + '" 转换为分数 ' )
324324 }
325325 }
326326 } , {
@@ -334,7 +334,7 @@ export const createTyped = /* #__PURE__ */ factory('typed', dependencies, functi
334334 try {
335335 return new Complex ( x )
336336 } catch ( err ) {
337- throw new Error ( 'Cannot convert "' + x + '" to Complex ' )
337+ throw new Error ( '无法将 "' + x + '" 转换为复数 ' )
338338 }
339339 }
340340 } , {
@@ -405,8 +405,7 @@ export const createTyped = /* #__PURE__ */ factory('typed', dependencies, functi
405405 // check if the function can be unary:
406406 signatures . some ( sig => ! sig . params . includes ( ',' ) ) ) {
407407 const err = new TypeError (
408- `Function '${ name } ' doesn't apply to matrices. To call it ` +
409- `elementwise on a matrix 'M', try 'map(M, ${ name } )'.` )
408+ `函数 '${ name } ' 不适用于矩阵。要对矩阵M逐元素调用函数,请使用 'map(M, ${ name } )'。` )
410409 err . data = usualError . data
411410 throw err
412411 }
@@ -424,8 +423,7 @@ export const createTyped = /* #__PURE__ */ factory('typed', dependencies, functi
424423 // check if the function can be unary:
425424 signatures . some ( sig => ! sig . params . includes ( ',' ) ) ) {
426425 const err = new TypeError (
427- `Function '${ name } ' doesn't apply to matrices. To call it ` +
428- `elementwise on a matrix 'M', try 'map(M, ${ name } )'.` )
426+ `函数 '${ name } ' 不适用于矩阵。要对矩阵M逐元素调用函数,请使用 'map(M, ${ name } )'。` )
429427 err . data = usualError . data
430428 throw err
431429 }
@@ -436,17 +434,17 @@ export const createTyped = /* #__PURE__ */ factory('typed', dependencies, functi
436434} )
437435
438436function throwNoBignumber ( x ) {
439- throw new Error ( `Cannot convert value ${ x } into a BigNumber: no class 'BigNumber' provided ` )
437+ throw new Error ( `无法将值 ${ x } 转换为大数:未启用大数 ` )
440438}
441439
442440function throwNoComplex ( x ) {
443- throw new Error ( `Cannot convert value ${ x } into a Complex number: no class 'Complex' provided ` )
441+ throw new Error ( `无法将值 ${ x } 转换为复数:未启用复数 ` )
444442}
445443
446444function throwNoMatrix ( ) {
447- throw new Error ( 'Cannot convert array into a Matrix: no class \'DenseMatrix\' provided ' )
445+ throw new Error ( '无法将数组转换为矩阵:未启用矩阵 ' )
448446}
449447
450448function throwNoFraction ( x ) {
451- throw new Error ( `Cannot convert value ${ x } into a Fraction, no class 'Fraction' provided. ` )
449+ throw new Error ( `无法将值 ${ x } 转换为分数,未启用分数 ` )
452450}
0 commit comments