@@ -216,86 +216,110 @@ func getRangeError[NumOut Number, NumIn Number](value NumIn) error {
216216 }
217217}
218218
219- // ToInt attempts to convert any [Type ] value to an int.
219+ // ToInt attempts to convert any [Number ] value to an int.
220220// If the conversion results in a value outside the range of an int,
221221// an [ErrConversionIssue] error is returned.
222+ //
223+ // Deprecated: use [Convert] instead with Convert[int](i)
222224func ToInt [T Number ](i T ) (int , error ) {
223225 return convertFromNumber [int ](i )
224226}
225227
226228// ToUint attempts to convert any [Number] value to an uint.
227229// If the conversion results in a value outside the range of an uint,
228230// an [ErrConversionIssue] error is returned.
231+ //
232+ // Deprecated: use [Convert] instead with Convert[uint](i)
229233func ToUint [T Number ](i T ) (uint , error ) {
230234 return convertFromNumber [uint ](i )
231235}
232236
233237// ToInt8 attempts to convert any [Number] value to an int8.
234238// If the conversion results in a value outside the range of an int8,
235239// an [ErrConversionIssue] error is returned.
240+ //
241+ // Deprecated: use [Convert] instead with Convert[int8](i)
236242func ToInt8 [T Number ](i T ) (int8 , error ) {
237243 return convertFromNumber [int8 ](i )
238244}
239245
240246// ToUint8 attempts to convert any [Number] value to an uint8.
241247// If the conversion results in a value outside the range of an uint8,
242248// an [ErrConversionIssue] error is returned.
249+ //
250+ // Deprecated: use [Convert] instead with Convert[uint8](i)
243251func ToUint8 [T Number ](i T ) (uint8 , error ) {
244252 return convertFromNumber [uint8 ](i )
245253}
246254
247255// ToInt16 attempts to convert any [Number] value to an int16.
248256// If the conversion results in a value outside the range of an int16,
249257// an [ErrConversionIssue] error is returned.
258+ //
259+ // Deprecated: use [Convert] instead with Convert[int16](i)
250260func ToInt16 [T Number ](i T ) (int16 , error ) {
251261 return convertFromNumber [int16 ](i )
252262}
253263
254264// ToUint16 attempts to convert any [Number] value to an uint16.
255265// If the conversion results in a value outside the range of an uint16,
256266// an [ErrConversionIssue] error is returned.
267+ //
268+ // Deprecated: use [Convert] instead with Convert[uint16](i)
257269func ToUint16 [T Number ](i T ) (uint16 , error ) {
258270 return convertFromNumber [uint16 ](i )
259271}
260272
261273// ToInt32 attempts to convert any [Number] value to an int32.
262274// If the conversion results in a value outside the range of an int32,
263275// an [ErrConversionIssue] error is returned.
276+ //
277+ // Deprecated: use [Convert] instead with Convert[int32](i)
264278func ToInt32 [T Number ](i T ) (int32 , error ) {
265279 return convertFromNumber [int32 ](i )
266280}
267281
268282// ToUint32 attempts to convert any [Number] value to an uint32.
269283// If the conversion results in a value outside the range of an uint32,
270284// an [ErrConversionIssue] error is returned.
285+ //
286+ // Deprecated: use [Convert] instead with Convert[uint32](i)
271287func ToUint32 [T Number ](i T ) (uint32 , error ) {
272288 return convertFromNumber [uint32 ](i )
273289}
274290
275291// ToInt64 attempts to convert any [Number] value to an int64.
276292// If the conversion results in a value outside the range of an int64,
277293// an [ErrConversionIssue] error is returned.
294+ //
295+ // Deprecated: use [Convert] instead with Convert[int64](i)
278296func ToInt64 [T Number ](i T ) (int64 , error ) {
279297 return convertFromNumber [int64 ](i )
280298}
281299
282300// ToUint64 attempts to convert any [Number] value to an uint64.
283301// If the conversion results in a value outside the range of an uint64,
284302// an [ErrConversionIssue] error is returned.
303+ //
304+ // Deprecated: use [Convert] instead with Convert[uint64](i)
285305func ToUint64 [T Number ](i T ) (uint64 , error ) {
286306 return convertFromNumber [uint64 ](i )
287307}
288308
289309// ToFloat32 attempts to convert any [Number] value to a float32.
290310// If the conversion results in a value outside the range of a float32,
291311// an [ErrConversionIssue] error is returned.
312+ //
313+ // Deprecated: use [Convert] instead with Convert[float32](i)
292314func ToFloat32 [T Number ](i T ) (float32 , error ) {
293315 return convertFromNumber [float32 ](i )
294316}
295317
296318// ToFloat64 attempts to convert any [Number] value to a float64.
297319// If the conversion results in a value outside the range of a float64,
298320// an [ErrConversionIssue] error is returned.
321+ //
322+ // Deprecated: use [Convert] instead with Convert[float64](i)
299323func ToFloat64 [T Number ](i T ) (float64 , error ) {
300324 return convertFromNumber [float64 ](i )
301325}
0 commit comments